summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-11-07 12:48:18 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-11-07 12:48:18 (GMT)
commit4a3c7c4ecf3fef60633c50b3ab07057afdd7fe18 (patch)
tree8640105632bcbc90ac299bdd6800324b7cfd0f65 /Doc/library
parent35adf5dcf16e966c167899f87eee357ffc4de6b4 (diff)
downloadcpython-4a3c7c4ecf3fef60633c50b3ab07057afdd7fe18.zip
cpython-4a3c7c4ecf3fef60633c50b3ab07057afdd7fe18.tar.gz
cpython-4a3c7c4ecf3fef60633c50b3ab07057afdd7fe18.tar.bz2
Issue #10145: the float.is_integer method was undocumented.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/stdtypes.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 0ac870b..9f2831a 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -530,10 +530,20 @@ The float type has some additional methods.
.. method:: float.as_integer_ratio()
- Return a pair of integers whose ratio is exactly equal to the
- original float and with a positive denominator. Raises
- :exc:`OverflowError` on infinities and a :exc:`ValueError` on
- NaNs.
+ Return a pair of integers whose ratio is exactly equal to the
+ original float and with a positive denominator. Raises
+ :exc:`OverflowError` on infinities and a :exc:`ValueError` on
+ NaNs.
+
+.. method:: float.is_integer()
+
+ Return ``True`` if the float instance is finite with integral
+ value, and ``False`` otherwise::
+
+ >>> (-2.0).is_integer()
+ True
+ >>> (3.2).is_integer()
+ False
Two methods support conversion to
and from hexadecimal strings. Since Python's floats are stored