-
Notifications
You must be signed in to change notification settings - Fork 99
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
Unitless quantities should convert to primitives #64
Comments
The way to do this right now is to directly access the I haven't put much thought into dimensionless quantities at this point as I wanted to complete #3. This issue touches on dimensionless quantities because similar to the difference between I'll leave the issue open with the intention of implementing let start = Time::new::<second>(1.0);
let end = Time::new::<second>(10.0);
let interval = Time::new::<second>(3.0);
let buckets: f32 = ((end - start) / interval).value;
println!("{}", buckets); |
The temporary workaround worked great. uom helped me solve a couple head scratching bugs. I'm excited for when dimensionless quantities become first class citizens 😄 |
Awesome! Glad to hear it helped solve some problems for you! |
Is there a dimensionless unit that can be used to get at the value in a unit-safe way? Like,
|
Not yet, but there will be "soon." I have most of the changes complete in the let buckets: f32 = ((end - start) / interval).get(ratio); |
That's great! An |
Line 35 in 7dec1f1
|
I expected something along the lines of the following to work:
I'm curious if I'm missing something, as I'm still exploring the library. Currently the workaround seems to be
Which isn't as pretty 😄
The text was updated successfully, but these errors were encountered: