f32, f64, etc. have functions called max and min that are defined to return the higher/lower non-NaN number. AFAICT it's not possible to actually call them on unit types without manually unpacking with either .value_raw or creating a dimensionless quantity and derefing. Please consider adding max and min functions on the unit types if the primitive type has them.
It would be great to also implement sin / cos / ... to make calculations with units easier. Right now, we have to do a lot of manual unpacking to do any meaningful calculations with units..
f32
,f64
, etc. have functions calledmax
andmin
that are defined to return the higher/lower non-NaN number. AFAICT it's not possible to actually call them on unit types without manually unpacking with either.value_raw
or creating a dimensionless quantity and derefing. Please consider addingmax
andmin
functions on the unit types if the primitive type has them.