Message91443
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.) |
|
Date |
User |
Action |
Args |
2009-08-10 13:44:26 | Cyborg16 | set | recipients:
+ Cyborg16 |
2009-08-10 13:44:25 | Cyborg16 | set | messageid: <1249911865.84.0.497315252674.issue6675@psf.upfronthosting.co.za> |
2009-08-10 13:44:24 | Cyborg16 | link | issue6675 messages |
2009-08-10 13:44:23 | Cyborg16 | create | |
|