Why float('Nan') == float('Nan') is False
ast <none at gmail.com> writes:
>>>> float('Nan') == float('Nan')
> Why ?
Others have given the real answer -- IEEE says so, and the people who
wrote the standard are smarter than me. All the same, this is my take
on the reason for it: NaN is specifically a representation for "this
has no value". The == operator compares the values of its operands;
something that has no value can't == anything, including itself.