[Python-Dev] Mixing float and Decimal -- thread reboot

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Mar 24 20:51:46 CET 2010

On Wed, Mar 24, 2010 at 2:50 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> On Wed, Mar 24, 2010 at 6:26 PM, Alexander Belopolsky
> <alexander.belopolsky at gmail.com> wrote:
>> Mark, I wonder if you could describe an algorithm off the top of your
>> head that relies on NaN == NaN being false.
> No, I certainly couldn't!  And I often wonder if the original IEEE 754
> committee, given 20/20 foresight, would have made the same decisions
> regarding comparisons of nans.  It's certainly not one of my favourite
> features of IEEE 754.

I tried to google the rationale for the IEEE 754 decision, but came up
with nothing.

Here are a few representative results:

So without fear let me not stop at the arguments that “the committee
must have voted on this point and they obviously knew what they were
doing” and “it is the standard and implemented on zillions of
machines, you cannot change it now”.
- "Reflexivity, and other pillars of civilization" by Bertrand Meyer

I suppose this simplifies numerical computations in some way, but I
couldn't find an explicitly stated reason, not even in the Lecture
Notes on the Status of IEEE 754 by Kahan which discusses other design
decisions in detail.

- "What is the rationale for all comparisons returning false for
IEEE754 NaN values?"

More information about the Python-Dev mailing list