]> granicus.if.org Git - python/commitdiff
#3288: Document as_integer_ratio
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 13 Sep 2008 02:11:51 +0000 (02:11 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 13 Sep 2008 02:11:51 +0000 (02:11 +0000)
Doc/library/stdtypes.rst

index 6802f3096b866510d4e276a44f80f6b73b5301ca..737ea9743093d04d2659144ac20a3d46a477f442 100644 (file)
@@ -449,7 +449,18 @@ Notes:
 Additional Methods on Float
 ---------------------------
 
-The float type has some additional methods to support conversion to
+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.
+    
+    .. versionadded:: 2.6
+
+Two methods support conversion to
 and from hexadecimal strings.  Since Python's floats are stored
 internally as binary numbers, converting a float to or from a
 *decimal* string usually involves a small rounding error.  In