1

I've tried to get 2^64 in Google Console.

I got this below:

Math.pow(2,64) = 18446744073709552000 (18,446,744,073,709,552,000)

And I tried another way:

var x = 1;
for(var i=1;i<=64;i++){x*=2}
console.log(x);

Both two returned the same result.

I felt it's strange that it ends with zero, so I calculated by Windows calculator and then I got the result below:

(((((2^2)^2)^2)^2)^2)^2 = 2^64 = 18,446,744,073,709,551,616.

Why the two results have such error?

I've tried to Google but I have no idea what keywords should I use.

Anything is appreciated and if this is duplicate please tell me.

Thanks.

Terry Wei
  • 1,521
  • 8
  • 16

0 Answers0