title: Check two float/double values for exact equality
body: <p>What is an elegant, readable and non-verbose way of comparing two floating point value for exact equality? </p>
  
  <p>As simple as it may sound, its a wicked problem. The <code>==</code> operator doesn't get the job done for NaN and also has special treatment for zero:</p>
  
  <pre><code>(+0.0 == -0.0) -&gt; true
  Double.NaN == Double.NaN -&gt; false
  </code></pre>
  
  <p>But I want to determine if two values are exactly the same (but I do <em>not</em> care for different NaN patterns, so any NaN == any other NaN -> true).</p>
  
  <p>I <em>can</em> do this with this ugly Monster piece of code:</p>
  
  <pre><code>Double.doubleToLongBits(a) == Double.doubleToLongBits(b)
  </code></pre>
  
  <p>Is there a better way to write this (and make the intent obvious)?</p>