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 bseiwald
Recipients
Date 2003-05-14.12:12:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
We found some strange behavior of the handling of "nan"
if "nan" is used in if-statements.

We use Python 2.2 (python2-2.2.2-11.7.3.src.rpm).
In the following i show the results of the
"experiments" with "nan", "inf" and usual floats:


$ python
Python 2.2.2 (#1, Jan 30 2003, 21:26:22) 
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> a=float(1.2345)
>>> b=float("inf")
>>> c=float("nan")
>>> if a==b:
...  print "equal"
... 
>>> if a==c:
...  print "equal"
... 
equal
>>> if b==c:
...  print "equal"
... 
equal


Bernhard Seiwald seiwald@itp.tugraz.at
History
Date User Action Args
2007-08-23 14:13:18adminlinkissue737648 messages
2007-08-23 14:13:18admincreate