 <p>Java uses <a href="http://en.wikipedia.org/wiki/IEEE_754" rel="nofollow noreferrer">IEEE 754</a> for its floating point numbers and therefore follows their rules.</p> <p>According to the <a href="http://en.wikipedia.org/wiki/NaN" rel="nofollow noreferrer">Wikipedia page on NaN</a> it is defined like this:</p> <blockquote> <p>A bit-wise example of a IEEE floating-point standard single precision NaN: <code>x111 1111 1axx xxxx xxxx xxxx xxxx xxxx</code> where <code>x</code> means <i>don't care</i>. </p> </blockquote> <p>So there are quite a few bit-patterns all of which are <code>NaN</code> values.</p>