osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why float('Nan') == float('Nan') is False


On Thu, Feb 14, 2019 at 6:55 AM Grant Edwards <grant.b.edwards at gmail.com> wrote:
>
> On 2019-02-13, Schachner, Joseph <Joseph.Schachner at Teledyne.com> wrote:
>
> > This makes some sense because NAN is Not A Number, so any comparison
> > to a number fails.
>
> Ah, but you now seem to be conflating "comparison fails" with
> "comparison has a boolean value of False".
>
> The alternative to (nan == nan) => False is probably not (nan == nan)
> => True: it's (nan == nan) => exception.

Or (nan == nan) => nan, which is what "infections nan" would be like.
(Compare NULL.)

ChrisA