Message91446
Section 5.11 of IEEE 754-2008, paragraph 2, says:
"""Infinite operands of the same sign shall compare equal."""
So Python's behaviour follows the standard here.
Producing 'is close to' tests is always tricky if you want to be able to
deal with IEEE special values (subnormals, negative zero, infinities,
NaNs). You could always write your unittest as:
if not (value1 == value2 or <relative_error_test>).
but this still doesn't consider NaNs, and probably doesn't do what you
want for subnormals either.
Closing as invalid. |
|
Date |
User |
Action |
Args |
2009-08-10 14:16:20 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, Cyborg16 |
2009-08-10 14:16:20 | mark.dickinson | set | messageid: <1249913780.23.0.129120240816.issue6675@psf.upfronthosting.co.za> |
2009-08-10 14:16:17 | mark.dickinson | link | issue6675 messages |
2009-08-10 14:16:17 | mark.dickinson | create | |
|