Suggests that if we have Kelvins² and want Celcius² we don't need to do anything to our numbers, which seems quite incorrect.
This behaviour is adopted by ut_convert, and can -in my opinion- lead to some unexpected results.
I confess I don't have the background to really have a strong physical sense of what the operation should do, but a better default behaviour would surely to honour the offset...
x/K² = x/degC² + 2 · 273.15 (x/degC)⁻² + 273.15²
And
(x/degC²) = (x/K²) - 2 · 273.15 (x/K)⁻² + 273.15²
And to raise in ut_convert if x is a negative quantity (to keep the results in ℝ+).
Have I overlooked some reason why offset units behave in the way they do, or is it just something that hasn't yet been needed/implemented?
In https://github.com/Unidata/UDUNITS-2/blob/v2.2.27.6/lib/unitcore.c#L1784-L1822 offsets are dropped when raising a unit to the given power. This is demonstrated succinctly with:
Clearly we can subtract 273.15 from our Kelvins to reach Celsius. But,
Suggests that if we have Kelvins² and want Celcius² we don't need to do anything to our numbers, which seems quite incorrect.
This behaviour is adopted by
ut_convert
, and can -in my opinion- lead to some unexpected results.I confess I don't have the background to really have a strong physical sense of what the operation should do, but a better default behaviour would surely to honour the offset...
And
And to raise in
ut_convert
ifx
is a negative quantity (to keep the results in ℝ+).Have I overlooked some reason why offset units behave in the way they do, or is it just something that hasn't yet been needed/implemented?