Index: pep-0754.txt =================================================================== --- pep-0754.txt (Revision 59923) +++ pep-0754.txt (Arbeitskopie) @@ -17,7 +17,47 @@ This PEP has been rejected. After sitting open for four years, it has failed to generate sufficient community interest. +Several ideas of this PEP were implemented for Python 2.6. ``float('inf')`` +and ``repr(float('inf'))`` are now guaranteed to work on every supported +platform with IEEE 754 semantics. However the ``eval(repr(float('inf')))`` +roundtrip is still not supported unless you define inf and nan yourself:: + >>> inf = float('inf') + >>> inf, 1E400 + (inf, inf) + >>> neginf = float('-inf') + >>> neginf, -1E400 + (-inf, -inf) + >>> nan = float('nan') + >>> nan, inf * 0. + (nan, nan) + +The math and the sys module have gained additional features, too:: + + >>> import math, sys + >>> from pprint import pprint + >>> pprint(sys.float_info) + {'dig': 15, + 'epsilon': 2.2204460492503131e-16, + 'mant_dig': 53, + 'max': 1.7976931348623157e+308, + 'max_10_exp': 308, + 'max_exp': 1024, + 'min': 2.2250738585072014e-308, + 'min_10_exp': -307, + 'min_exp': -1021, + 'radix': 2, + 'rounds': 1} + >>> math.isinf(inf), math.isnan(inf) + (True, False) + >>> math.isinf(nan), math.isnan(nan) + (False, True) + >>> math.copysign(1, 0.) + 1.0 + >>> math.copysign(1, -0.) + -1.0 + + Abstract ========