-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
Incorrect rounding in floating-point operations with gcc/x87 #47186
Comments
On some older Intel 32-bit hardware, under Linux, floating-point Python 2.6a3+ (trunk:63521, May 21 2008, 15:40:39)
[GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e16 + 2.999
10000000000000002.0
>>> 1e16 + 2.9999
10000000000000004.0 The second result should really be 1e16+2., not 1e16+4. This appears to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 Various fixes are possible. One possible fix is to add the -ffloat- It's not clear to me that this *should* be fixed, but I think the |
Python (the language) makes no guarantee itself on what the precise http://docs.python.org/ref/types.html "These represent machine-level double precision floating point numbers. If you want to, one could add ", precision" in the sentence; I think it |
Okay; so this is definitely not a Python bug---it's a well-known Nevertheless, it was a surprise to me when my (supposedly IEEE 754 There's an excellent recent article by David Monniaux, "The pitfalls of http://hal.archives-ouvertes.fr/hal-00128124 that explains exactly what's going on here (it's a case of double- Do you think a documentation patch that added this reference, along with One other thing that's worth mentioning: on Pentium 4 and later, the In any case, I guess this report should be closed as 'invalid', but I |
Closing as invalid. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: