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 mark.dickinson
Recipients Cyborg16, mark.dickinson, tim.peters
Date 2009-08-10.14:16:17
SpamBayes Score 1.7749646e-05
Marked as misclassified No
Message-id <1249913780.23.0.129120240816.issue6675@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-08-10 14:16:20mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, Cyborg16
2009-08-10 14:16:20mark.dickinsonsetmessageid: <1249913780.23.0.129120240816.issue6675@psf.upfronthosting.co.za>
2009-08-10 14:16:17mark.dickinsonlinkissue6675 messages
2009-08-10 14:16:17mark.dickinsoncreate