title: Calculating cubic root for negative number
body: <p>So, to be short,</p>
  
  <blockquote>
    <p><sup>3</sup>√(-8) = (-8)<sup>1/3</sup></p>
  </blockquote>
  
  <pre><code>console.log(Math.pow(-8,1/3));
  //Should be -2
  </code></pre>
  
  <p>But when I test it out, it outputs</p>
  
  <pre><code>NaN
  </code></pre>
  
  <p>Why? Is it a bug or it is expected to be like this in the first place? I am using JavaScript to draw graphs, but this messes up the graph.</p>