josdejong/mathjs

Error comparing temperature units with offset

Aperta

#3134 aperta il 21 gen 2024

 (11 commenti) (0 reazioni) (0 assegnatari)JavaScript (1314 fork)batch import
bughelp wanted

Metriche repository

Star
 (15.065 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Hi,

In versiones newer than 11.4.1 the comparison of temperatures is incorrect between some temperature units when an offset is involved.

lowTemp = 9 degC;
highTemp = 10 degC;

lowTemp         < highTemp          # true
lowTemp to degF < highTemp          # false but should be true
lowTemp to K    < highTemp          # false but should be true
lowTemp to degR < highTemp          # false but should be true
lowTemp to K    < highTemp to degF  # false but should be true
lowTemp to degR < highTemp to degF  # false but should be true

This was discussed in #2518 but this might need to be a separate issue.

Guida contributor