r-quantities / units

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

ut_scale does not support scaling by 0 #346

Closed Enchufa2 closed 1 year ago

Enchufa2 commented 1 year ago
> x1 <- set_units(0, "m")
> x2 <- set_units(3, "m")
> x1 < x2
Error in ud_compare(e1, e2, as.character(units(e1)), as.character(units(e2))) : 
  ut_scale(): NULL factor argument

Similarly,

> units:::R_ut_scale(units:::R_ut_parse("m"), 0)
Error in units:::R_ut_scale(units:::R_ut_parse("m"), 0) : 
  ut_scale(): NULL factor argument

Reported here, but meanwhile we need to do something about it.