Message 61385 - Python tracker (original) (raw)
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 "", line 1, in ValueError: math domain error
(Linux)
Christian