[Python-Dev] [patch] Improvements for float and math
lists at cheimes.de
Mon Dec 17 17:15:16 CET 2007
I've implemented several small improvements for floats and the math
module. You can find a description and the patches in our bug tracker:
* Full and platform independent round trip for +/-inf and nan. Before
the patch the round trip didn't work on Windows and Windows returned
different repr() for nan and inf (1.#INF and -1.#IND).
>>> 1e500 * 0.
* math.isnan() and math.isinf() functions. The Py_IS_NAN and
Py_IS_INFINITY macros now use isinf and isnan on platforms that support
the functions. Although they are C99 functions they are also available
on GNU89 (C89 + GNU extensions) and other platforms. We already use them
* math.sign() function
On platforms with full IEEE 754 semantics and copysign() support:
* Py_MATH_PI and Py_MATH_E macros with long double precision for future use.
* 1st and 2nd kind Bessel functions (j0, j1. jn, y0, y1, yn), error
functions (erf, erfc) and gamma function (lgamma with sign). They are
available in most libm libraries.
Please review the patches and comment on them.
More information about the Python-Dev