title: Why Math.pow(a, b) is NaN when a is a negative number and b is a non-integer?
body: <p>I observed the following Javascript behavior:</p>
  
  <pre><code>&gt; Math.pow(4, 2)
  16
  &gt; Math.pow(4, 2.1)
  18.37917367995256
  &gt; Math.pow(4, 0.5)
  2
  &gt; Math.pow(-4, 2)
  16
  &gt; Math.pow(-4, 2.1)
  NaN
  &gt; Math.pow(-4, 0.5)
  NaN
  </code></pre>
  
  <p>Why giving a negative number and a non-integer but rational number, makes <code>Math.pow</code> to return <code>NaN</code>?</p>
  
  <p>For example, why <code>Math.pow(4, 0.5)</code> is <strong>not</strong> <code>NaN</code> but <code>Math.pow(4, -0.5)</code> <strong>is</strong> <code>NaN</code>?</p>