Closed eriknstevenson closed 6 years ago
Hi Erik, just use the unit one
! :)
On 5 May 2018, at 17:03, Erik Stevenson notifications@github.com wrote:
Hello,
First of all, thanks for the work you have put into this library, I have found it to be quite useful in my project. Just hoping to get some clarification on what is the best way to obtain a numerical value from a dimensionless quantity.
The documentation is clear for cases in which the value has a unit:
v :: Velocity Prelude.Double v = 90 *~ (kilo meter / hour) numval :: Prelude.Double numval = v /~ (meter / second) However, for cases such as the following:
v2 :: Velocity Prelude.Double v2 = 150 *~ (kilo meter / hour) vratio :: Dimensionless Double vratio = v / v2 I am unsure of what unit to divide by here to obtain the double on its own.
I have currently resorted to the following:
numvratio :: Double numvratio = (v /~ (kilo meter / hour)) Prelude./ (v2 /~ (kilo meter / hour)) Just wondering if there might be a nicer way to do this, and I apologize if I have missed something obvious in the documentation.
Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Perfect! Thank you.
If you have suggestions as to how to improve the examples to make this more clear, they would be appreciated.
Hello,
First of all, thanks for the work you have put into this library, I have found it to be quite useful in my project. Just hoping to get some clarification on what is the best way to obtain a numerical value from a dimensionless quantity.
The documentation is clear for cases in which the value has a unit:
However, for cases such as the following:
I am unsure of what unit to divide by here to obtain the double on its own.
I have currently resorted to the following:
Just wondering if there might be a nicer way to do this, and I apologize if I have missed something obvious in the documentation.
Thanks!