> We need to remember that a significant number of Python users don't
> have any idea what IEE-754 is, and have never heard of a NaN (and
> possibly even of infinity as a number). Those people are *far* better
> served by being told "you made a mistake" in the form of an exception,
> rather than via a weird numeric value that doesn't work how they
> expect and doesn't even look like a number when they print it.
> Paul

My feeling is that both viewpoints can be satisfied by having a context whereby if USE_IEEE_SPECIAL_VALUES (to pick a random name) is False (the default) such operations will raise an exception but if it is True INF, -INF or NaN is returned (ideally with some debug output this would be in the spirit of the IEEE Signalling NaN).


Steve Barnes