Equality of same NaN instances?

Last debate on python-dev about behavior NaNs in containers raised another important question: Should the instance of NaN be equal to itself? P.S. Of course I suppose that different instances of NaN do not have to be equal. --- Zaur

This has been discussed before. See http://mail.python.org/pipermail/python-ideas/2010-March/thread.html#6945 etc. for background on the issue. My two cents? Follow what C does/the IEEE spec unless there's a really compelling reason to do something else.

On Thu, Apr 28, 2011 at 4:08 AM, Carl M. Johnson <cmjohnson.mailinglist@gmail.com> wrote: ..
My two cents? Follow what C does/the IEEE spec unless there's a really compelling reason to do something else.
One good thing about standards is that there are plenty to choose from. IMO, Python's "float" type is much closer to Java's "Double" than to machine FP types standardized by IEEE 754. If nothing else, annual reoccurrence of long threads on this topic is a reason enough to reconsider which standard to follow.

This has been discussed before. See http://mail.python.org/pipermail/python-ideas/2010-March/thread.html#6945 etc. for background on the issue. My two cents? Follow what C does/the IEEE spec unless there's a really compelling reason to do something else.

On Thu, Apr 28, 2011 at 4:08 AM, Carl M. Johnson <cmjohnson.mailinglist@gmail.com> wrote: ..
My two cents? Follow what C does/the IEEE spec unless there's a really compelling reason to do something else.
One good thing about standards is that there are plenty to choose from. IMO, Python's "float" type is much closer to Java's "Double" than to machine FP types standardized by IEEE 754. If nothing else, annual reoccurrence of long threads on this topic is a reason enough to reconsider which standard to follow.
participants (4)
-
Alexander Belopolsky
-
Carl M. Johnson
-
Guido van Rossum
-
ZS