-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make BigDecimal
's comparisons exact
#13554
Make BigDecimal
's comparisons exact
#13554
Conversation
This PR broke the simple |
That's because 1.1 is indeed not equal to 1.100000000000000088817841970012523233890533447265625. This is not a bug, use |
Hm, I suppose the confusing part of this is that |
Conversions from
BigRational | Float
toBigDecimal
are inexact, but conversions fromBigDecimal | Float
toBigRational
are exact, so the latter ones are used to implement#<=>
.Comparisons between
BigDecimal
andFloat::Primitive
now respect infinities and NaNs.