4 ms·
Each of the dimensions has a "primary unit", which the constructors convert into. For Length it's Meters, so Meters(2) stores a 2, whilst Microns(7) will store
by chriswarbo 3y ago
Each of the dimensions has a "primary unit", which the constructors convert into. For Length it's Meters, so Meters(2) stores a 2, whilst Microns(7) will store a 0.000007 https://www.javadoc.io/doc/org.typelevel/squants_2.13/1.6.0/squants/space/Length$.html https://www.javadoc.io/doc/org.typelevel/squants_2.13/1.6.0/...
- EnigmaFlare 3y agoSurely that spoils some cases where you use different units to keep the values of reasonable magnitude? Sometimes, such as with electromagnetics, the exponents are so extreme they lead to numerical error. Sometimes also, people (inappropriately) use arbitrary epsilons to compare to zero and end up nuking micron-scale dimensions expressed in meters. A volume of 1 μm^3 is 1e-18m^3 which you might not want to operate on too hard.