title: Negative Number to Non-Integer Power in Javascript
body: <p>I'm writing a script that has to do something like this at one point: <code>Math.pow(-2,1.5)</code>. The result should be approximately -2.82843, but instead, Javascript returns <code>NaN</code>. (I tried this in both Google Chrome 17 and Mozilla Firefox 11.) If the exponent is an integer, such as in <code>Math.pow(-2,3)</code>, then Javascript will return the right answer, which, in this case, is -8. Positive numbers also correctly raise to non-integer powers; <code>Math.pow(2,1.5)</code> evaluates to approximately 2.8284271247461903. Is there any way that I can get Javascript to calculate the value of a negative number to a non-integer power? </p>