Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choosing type of quantity value based on type used in construction #65

Open
gaurav-arya opened this issue Oct 15, 2023 · 1 comment · May be fixed by #66
Open

Choosing type of quantity value based on type used in construction #65

gaurav-arya opened this issue Oct 15, 2023 · 1 comment · May be fixed by #66

Comments

@gaurav-arya
Copy link
Collaborator

Arguably, when we do 1.0f0u"m", the floating point backing type should remain Float32 rather than being converted to Float64:

julia> (1.0f0u"m").value
1.0

In general, there's a question of what type we should choose for the quantity value. In theory, we could even keep integers as integers, i.e. 1u"m" would remain 1 m. But perhaps we would want to enforce floating point, in which case something like float(T) might make sense.

@MilesCranmer
Copy link
Member

MilesCranmer commented Oct 15, 2023

I tried doing this with #66 but I'm not sure if it's the right way to go. Wdyt?

@MilesCranmer MilesCranmer linked a pull request Oct 16, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants