I'm trying to calculate Math.pow(2,1000)
and I am getting Result : "1.0715086071862673e+301"
If I try Math.pow(2,10000)
, then I get Result : "Infinity"
.
Can anyone help me to solve this using javascript?
I'm trying to calculate Math.pow(2,1000)
and I am getting Result : "1.0715086071862673e+301"
If I try Math.pow(2,10000)
, then I get Result : "Infinity"
.
Can anyone help me to solve this using javascript?
You can also try https://github.com/peterolson/BigInteger.js for big number calculation.
You can't calculate such large numbers solely with JavaScript, you will probably need to use a library for that.
Please take a look at https://github.com/jtobey/javascript-bignum or http://jsfromhell.com/classes/bignumber