You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Within the range of IEEE binary128 numbers, BigDecimal will agree with BigInt for both equality and hash codes (and will agree with primitive types as well)."
In some cases in Scala 2.11 this does not appear to be the case. The following example shows this regressing from 2.10 to 2.11:
It might be that this was simply dropped as a feature of BigDecimal. That would break some applications and it would be good to update the docs at least with a warning.
The text was updated successfully, but these errors were encountered:
So, that's not actually 123.312, is it? But my patch tried to make BigDecimal(123.312) be exactly 123.312 (i.e. the decimal fractional value, not the Double approximation), since there were a lot of consistency gotchas around BigDecimal/Double interconversion.
I'll see if it's practical to fix isValidDouble or hashCode to agree with the string representation of the Double, not the actual value. I think I just forgot to switch this out for equivalentToDouble.
The docs of BigDecimal say the following:
"Within the range of IEEE binary128 numbers, BigDecimal will agree with BigInt for both equality and hash codes (and will agree with primitive types as well)."
In some cases in Scala 2.11 this does not appear to be the case. The following example shows this regressing from 2.10 to 2.11:
2.10
2.11
It might be that this was simply dropped as a feature of BigDecimal. That would break some applications and it would be good to update the docs at least with a warning.
The text was updated successfully, but these errors were encountered: