[issue1640] Enhancements for mathmodule

Christian Heimes report at bugs.python.org
Mon Jan 21 13:24:51 CET 2008


Christian Heimes added the comment:

Mark Dickinson wrote:
> So e.g. cos(infinity) should give a ValueError, while log(infinity) and exp(infinity) 
> should not raise any Python exception, but should return an infinity instead.  And most 
> single variable operations should return an input NaN unaltered, without raising an 
> exception.

The matter should be discussed in a proper PEP and targeted for Python
3.0. Python 3.0 is the right place for subtle changes which may break
code. For Python 2.6 we must not change the exception or outcome of a
function and new functions should be as consistent with existing ones as
possible.

I still don't like the idea of math.atanh(1) == inf. Why? See for yourself:

18.714973875118524
>>> math.atanh(.99999999999999999)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: math domain error

(Linux)

Christian

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


More information about the Python-bugs-list mailing list