[Python-checkins] r66435 - python/trunk/Doc/library/stdtypes.rst

andrew.kuchling python-checkins at python.org
Sat Sep 13 04:11:51 CEST 2008


Author: andrew.kuchling
Date: Sat Sep 13 04:11:51 2008
New Revision: 66435

Log:
#3288: Document as_integer_ratio

Modified:
   python/trunk/Doc/library/stdtypes.rst

Modified: python/trunk/Doc/library/stdtypes.rst
==============================================================================
--- python/trunk/Doc/library/stdtypes.rst	(original)
+++ python/trunk/Doc/library/stdtypes.rst	Sat Sep 13 04:11:51 2008
@@ -449,7 +449,18 @@
 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


More information about the Python-checkins mailing list