r-quantities / units

Measurement units for R
https://r-quantities.github.io/units
172 stars 27 forks source link

ut_compare fails for an identity unit #347

Closed Enchufa2 closed 1 year ago

Enchufa2 commented 1 year ago

Maybe related to #346, but a bit different: there are issues too when the scaling factor is equal to 1. More specifically:

units:::ud_compare(0.5, c(0.9, 1, 2), "m", "m")
#> [1] -1  1 -1

0.5 m is considered greater than 1 m (!).

Enchufa2 commented 1 year ago

So it seems that ut_compare doesn't work as we expected, so we need to rework this.