This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Cyborg16
Recipients Cyborg16
Date 2009-08-10.13:44:22
SpamBayes Score 1.8563382e-08
Marked as misclassified No
Message-id <1249911865.84.0.497315252674.issue6675@psf.upfronthosting.co.za>
In-reply-to
Content
Currently python evaluates infinity as equal to itself in my tests (2.6.2 and 3.0.1+
from ubuntu). I'm not entirely sure whether the behaviour of 'inf == inf' is specified
by IEEE 754, but it leads to results like:

>>> 1e400
inf
>>> 1e400 == 1e500
True

And hence unittests which use tests like

if not (math.fabs(value1 - value2) <= 0.00000001 *
max(math.fabs(value1),math.fabs(value2))):
    fail

don't always fail when they should (when a value is inf).

This is a specific example (and probably not the recommended way of testing
values in any case), but I think "inf != inf" is generally considered the correct
behaviour. (Although maybe this is left over from the PEP 42 / PEP 754 mess; I
wasn't able to find the current status of implementing IEEE 754 behaviour in
python.)
History
Date User Action Args
2009-08-10 13:44:26Cyborg16setrecipients: + Cyborg16
2009-08-10 13:44:25Cyborg16setmessageid: <1249911865.84.0.497315252674.issue6675@psf.upfronthosting.co.za>
2009-08-10 13:44:24Cyborg16linkissue6675 messages
2009-08-10 13:44:23Cyborg16create