OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

seek confirmation of unbelievable Javascript Math.pow error [duplicate]

  • Thread starter Thread starter WayneF
  • Start date Start date
W

WayneF

Guest
I guess I am very confused, but in Javascript in Chrome and Firefox, this exact line

Code:
let a = Math.pow(-0.1119101, 0.2 );    // = -0.6453

produces NaN. But my handheld calculator says -0.6453

Which I believe, and it is an annualization number, and the inverse -0.6453 to 5th power is this 0.11189 (rounding). But I am computing NaN.

Seems unbelievable, but I have rebooted the computer but no change. The program runs fine without issues doing similar other numbers if this number is not included. It is Windows 11 and everything has its updates.

Is there some math or javascript issue that I'm not understanding? I would like to know if an actual bug, or some local problem.

Can anyone reproduce this error?

<p>I guess I am very confused, but in Javascript in Chrome and Firefox, this exact line</p>
<pre><code>let a = Math.pow(-0.1119101, 0.2 ); // = -0.6453
</code></pre>
<p>produces <code>NaN</code>. But my handheld calculator says -0.6453</p>
<p>Which I believe, and it is an annualization number, and the inverse -0.6453 to 5th power is this 0.11189 (rounding).
But I am computing NaN.</p>
<p>Seems unbelievable, but I have rebooted the computer but no change. The program runs fine without issues doing similar other numbers if this number is not included. It is Windows 11 and everything has its updates.</p>
<p>Is there some math or javascript issue that I'm not understanding?
I would like to know if an actual bug, or some local problem.</p>
<p>Can anyone reproduce this error?</p>
 
Top