Math.pow(-3, 2,6)
would give me NaN
Would it be correct to turn it in the following:
if exponent number before the decimal point is even (turn negative into positive)): Math.pow(3, 2,6)
if exponent number before the decimal point is odd (turn negative into positive first and make result negative again after calculation):
Math.pow(3, 2,6)
= 157.49069663608591
// make negative: -157.49069663608591
Is this way plain wrong or is there another way without rounding up or down the exponent?