-
Notifications
You must be signed in to change notification settings - Fork 39
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
Floating point error in Arithmetic command, given inputs of mixed precision #2629
Comments
Note that when there are two decimal points, it seems to work as expected:
|
This is a result of how ploating point arithmetic works using the IEEE 754 standard. While Python can handle arbitrarily large whole numbers, floating point precision is limited when performed using standard operations. Related: SublimeText/InsertNums#17 (comment) |
Excellent write-up and discussion there, @FichteFoll. |
That's not true, it depends on the numbers you're using, mess around a bit with different combinations and you can observe that any slight difference on any number can trigger or untrigger this behavior. Python even contains the function |
That said, we can use I could implement this. But I'm not sure if the official maintainers want to add complexity to this code, so I'll just wait for any heads up from them here. :D |
Note |
Description
77350.77+30219.12+91520.32+75374.84+3390
should result in277855.05
, not277855.05000000005
Steps to reproduce
77350.77+30219.12+91520.32+75374.84+3390
Expected behavior
I expected the result to have been
277855.05
Actual behavior
277855.05000000005
is provided instead.Environment
The text was updated successfully, but these errors were encountered: