-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Specific double to decimal conversion has unexpected result #110439
Comments
Tagging subscribers to this area: @dotnet/area-system-numerics |
This is effectively a duplicate of #72135 Noting that the correct decimal result is not The basic issue here is that the This is a relatively low priority issue to fix and is a breaking change for something that has always behaved a particular way. Fixing it is likely to cause other issues and complaints downstream (likely more than one off cases like the above where the result appears to lose precision, because in practice the hidden precision will become more visible instead and lead users to raise more questions/issues). |
Going to close this as a duplicate and track an eventual fix against the original issue. But happy to answer any other questions on the topic here |
Description
When converting
double
value -802.05999999999949 todecimal
, it is rounded automatically to -802.06. However given -802.059999, conversion is returing proper value.Reproduction Steps
Expected behavior
I think the conversion for -802.05999999999949 should return the value without any rounding.
Actual behavior
Returning value is rounded to second decimal place.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: