title: Why check for !isNaN() after isFinite()?
body: <p>I came across the <code>goog.math.isFiniteNumber</code> function in the <a href="http://closure-library.googlecode.com/svn/!svn/bc/4/trunk/closure/goog/docs/closure_goog_math_math.js.html" rel="noreferrer">Google Closure Library</a>. What it does is checking whether a given number is both finite and not <code>NaN</code>.</p>
  
  <p>The underlying code is:</p>
  
  <pre><code>goog.math.isFiniteNumber = function(num) {
    return isFinite(num) &amp;&amp; !isNaN(num);
  };
  </code></pre>
  
  <p>So, first it checks whether the number is finite using the native <code>isFinite</code> function, and then does an additional check to make sure the number isn't <code>NaN</code> using <code>isNaN</code>.</p>
  
  <p>However, <code>isFinite</code> already returns false in case the argument is <code>NaN</code>. So, what advantages does the check for <code>isNaN</code> provide?</p>