lydia,
Welcome to Javaranch, a friendly place for
Java greenhorns
To answer your question,
JLS 4.2.3 Floating-Point Types, Formats, and Values
NaN is unordered, so the numerical comparison operators <, <=, >, and >= return false if either or both operands are NaN (�15.20.1). The equality operator == returns false if either operand is NaN, and the inequality operator != returns true if either operand is NaN (�15.21.1). In particular, x!=x is true if and only if x is NaN, and (x<y) == !(x>=y) will be false if x or y is NaN.
Moreover, we'd like you to read the
Javaranch Naming Policy and change your
publicly displayed name to comply with the rules. Thank you for your cooperation.
We hope you'll stay around.