diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-11-07 12:52:19 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-11-07 12:52:19 (GMT) |
commit | 5edac047f11f8d6e22231d9922363f334c4f4b0e (patch) | |
tree | e85020765ccc50e8d533a29195be74c817516b95 | |
parent | 69f9f201d9bd03dd30e19274a8f3965b758b9b41 (diff) | |
download | cpython-5edac047f11f8d6e22231d9922363f334c4f4b0e.zip cpython-5edac047f11f8d6e22231d9922363f334c4f4b0e.tar.gz cpython-5edac047f11f8d6e22231d9922363f334c4f4b0e.tar.bz2 |
Merged revisions 86293 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86293 | mark.dickinson | 2010-11-07 12:48:18 +0000 (Sun, 07 Nov 2010) | 1 line
Issue #10145: the float.is_integer method was undocumented.
........
-rw-r--r-- | Doc/library/stdtypes.rst | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5c47e9b..7293822 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -495,12 +495,24 @@ 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. - .. versionadded:: 2.6 + .. versionadded:: 2.6 + +.. 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 + + .. versionadded:: 2.6 Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored |