In native Python, without using NumPy (for which numpy.nan != numpy.nan
) there is no NaN, so am I right in thinking that Python's floating point ==
is reflexive? Then since it is symmetric (a == b
implies b == a
) and transitive (if a==b
and b==c
then a==c
), can we say that Python's ==
is an equivalence relation on the float
s?
EDIT: OK, so I learned that there is a NaN: float('nan')
(thanks @unutbu) which will propagate through various operations, but does any native Python method return it (rather than raising an Exception) without me introducing it by this assignment?