diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-08-04 18:42:43 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-08-04 18:42:43 (GMT) |
commit | 74f5902b045d582af36bf26a7a27d5e334a3f653 (patch) | |
tree | 5264c24b2f529fe34d5eda94e93137caeda3b06b /Doc | |
parent | 560f7647ce5991140e215a7ac775130798c92dc8 (diff) | |
download | cpython-74f5902b045d582af36bf26a7a27d5e334a3f653.zip cpython-74f5902b045d582af36bf26a7a27d5e334a3f653.tar.gz cpython-74f5902b045d582af36bf26a7a27d5e334a3f653.tar.bz2 |
Issue #9498: Add reference to sys.float_info from 'numeric types' docs.
Thanks Yitz Gale.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/stdtypes.rst | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5f1b732..76921cd 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -217,14 +217,15 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex` There are three distinct numeric types: :dfn:`integers`, :dfn:`floating point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating point -numbers are implemented using :ctype:`double` in C---all bets on their -precision are off unless you happen to know the machine you are working -with. Complex numbers have a real and imaginary part, which are each -implemented using :ctype:`double` in C. To extract these parts from a -complex number *z*, use ``z.real`` and ``z.imag``. (The standard library -includes additional numeric types, :mod:`fractions` that hold rationals, -and :mod:`decimal` that hold floating-point numbers with user-definable -precision.) +numbers are usually implemented using :ctype:`double` in C; information +about the precision and internal representation of floating point +numbers for the machine on which your program is running is available +in :data:`sys.float_info`. Complex numbers have a real and imaginary +part, which are each a floating point number. To extract these parts +from a complex number *z*, use ``z.real`` and ``z.imag``. (The standard +library includes additional numeric types, :mod:`fractions` that hold +rationals, and :mod:`decimal` that hold floating-point numbers with +user-definable precision.) .. index:: pair: numeric; literals |