NaN is a float
Note that NaN is a float:
?- X is nan, float(X). X = 1.5NaN.
But it incomparable, i.e. not anywhere on the (pseudo) real line:
?- X is nan, float(X), \+ (X < 0), \+ (X > 0), \+ (X =:= 0). X = 1.5NaN.
Arithmetic comparison between NaN also fails, but unification succeeds
?- X is nan, Y is nan, X = Y. X = Y, Y = 1.5NaN.
?- X is nan, Y is nan, X =:= Y. false.