[issue1640] Enhancements for mathmodule

Guido van Rossum report at bugs.python.org
Thu Jan 3 01:11:00 CET 2008


Guido van Rossum added the comment:

One nit: you added a blank line to the end of test_math.py.
This will cause the checkin to fail. :-)

One bigger issue: the sign() function doesn't seem to work properly for
nans.  E.g. on Linux I get:

>>> inf = 1e1000
>>> nan = inf/inf
>>> mnan = -nan
>>> math.sign(nan)
-1
>>> math.sign(mnan)
1

IOW a positive nan is considered negative and vice versa.  (This is
probably due to the way nans defy testing, always returning false.)

I'm also curious why math.sign(0.0) returns 1 -- this is going to cause
a lot of confusion.

This is also missing doc patches.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1640>
__________________________________


More information about the Python-bugs-list mailing list