diff options
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 14fd1a7..02c709c2 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -435,7 +435,8 @@ available. They are listed here in alphabetical order. Convert a string or a number to floating point. If the argument is a string, it must contain a possibly signed decimal or floating point number, possibly - embedded in whitespace. Otherwise, the argument may be an integer + embedded in whitespace. The argument may also be [+|-]nan or [+|-]inf. + Otherwise, the argument may be a plain integer or a floating point number, and a floating point number with the same value (within Python's floating point precision) is returned. If no argument is given, returns ``0.0``. @@ -447,9 +448,10 @@ available. They are listed here in alphabetical order. single: Infinity When passing in a string, values for NaN and Infinity may be returned, depending - on the underlying C library. The specific set of strings accepted which cause - these values to be returned depends entirely on the C library and is known to - vary. + on the underlying C library. Float accepts the strings nan, inf and -inf for + NaN and positive or negative infinity. The case and a leading + are ignored as + well as a leading - is ignored for NaN. Float always represents NaN and infinity + as nan, inf or -inf. The float type is described in :ref:`typesnumeric`. |