]> granicus.if.org Git - python/commitdiff
Merged revisions 86293 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Sun, 7 Nov 2010 12:52:19 +0000 (12:52 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 7 Nov 2010 12:52:19 +0000 (12:52 +0000)
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.
........

Doc/library/stdtypes.rst

index 5c47e9bb58e30a96f2133274738a3bddaea0525a..72938223ebebd4438ae71f89b05578b8beea9f49 100644 (file)
@@ -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