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
stdtypes.rst should refer to sys.float_info #53707
Comments
Library docs section 5.4 "Numeric Types" states about floating point numbers that "all bets on their precision are off unless you happen to know the machine you are working with." That has not been true since Python 2.6, when sys.float_info was added. There should be a reference to that here instead of that statement. In addition, that paragraph mentions that both float and complex are "implemented using double in C". There is no longer any special reason to mention how those are implemented in C, any more than anything else in Python. Everything you need to know about the implementation is in sys.float_info. (Well, almost everything, see bpo-9192.) The attached patch is for the Python 3.2 branch. |
Mark, does this look ok to you? |
+1 for the reference to sys.float_info. I'd prefer to keep the mention of C doubles, though. You have to know what you're looking for to get this information from looking at sys.float_info. |
It's not necessarily true for other than CPython, and it could theoretically not be true someday on some weird platform even for CPython. How about just adding this: "Floating point numbers are usually implemented using double in C." Then at least we're not committing ourselves to anything. |
Granted. Though it would be quite a major change: the 'double' part is heavily hard-coded throughout.
That sounds fine to me. |
Thanks! Applied in revisions r83732 through r83734. (The release26-maint branch is frozen except for essential fixes, so not applying it there.) |
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: