mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Clarification in the fp appendix suggested on c.l.py by Michael Chermside.
Also replaced a *star* style emphasis in the Representation Error section
with an \emph{} thingie.
This commit is contained in:
parent
4157dd5a92
commit
fa9e273442
2 changed files with 4 additions and 2 deletions
|
|
@ -4180,7 +4180,8 @@ turns out that's enough (on most machines) so that
|
||||||
Note that this is in the very nature of binary floating-point: this is
|
Note that this is in the very nature of binary floating-point: this is
|
||||||
not a bug in Python, it is not a bug in your code either, and you'll
|
not a bug in Python, it is not a bug in your code either, and you'll
|
||||||
see the same kind of thing in all languages that support your
|
see the same kind of thing in all languages that support your
|
||||||
hardware's floating-point arithmetic.
|
hardware's floating-point arithmetic (although some languages may
|
||||||
|
not \emph{display} the difference by default, or in all output modes).
|
||||||
|
|
||||||
Python's builtin \function{str()} function produces only 12
|
Python's builtin \function{str()} function produces only 12
|
||||||
significant digits, and you may wish to use that instead. It's
|
significant digits, and you may wish to use that instead. It's
|
||||||
|
|
@ -4326,7 +4327,7 @@ precision is that over 2**56, or
|
||||||
|
|
||||||
Note that since we rounded up, this is actually a little bit larger than
|
Note that since we rounded up, this is actually a little bit larger than
|
||||||
1/10; if we had not rounded up, the quotient would have been a little
|
1/10; if we had not rounded up, the quotient would have been a little
|
||||||
bit smaller than 1/10. But in no case can it be *exactly* 1/10!
|
bit smaller than 1/10. But in no case can it be \emph{exactly} 1/10!
|
||||||
|
|
||||||
So the computer never ``sees'' 1/10: what it sees is the exact
|
So the computer never ``sees'' 1/10: what it sees is the exact
|
||||||
fraction given above, the best 754 double approximation it can get:
|
fraction given above, the best 754 double approximation it can get:
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ Brad Chapman
|
||||||
Mitch Chapman
|
Mitch Chapman
|
||||||
David Chaum
|
David Chaum
|
||||||
Nicolas Chauvat
|
Nicolas Chauvat
|
||||||
|
Michael Chermside
|
||||||
Albert Chin-A-Young
|
Albert Chin-A-Young
|
||||||
Tom Christiansen
|
Tom Christiansen
|
||||||
Vadim Chugunov
|
Vadim Chugunov
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue