Skip to content Skip to sidebar Skip to footer

2 ** 256 Biginteger In Javascript

Which will normally result in 1.157920892373162e+77 ,but what I want is the accurate number of 2 ** 256 like 1157920892731685487456125..... I has try big-integer and math.js but bo

Solution 1:

Works fine using big-integer:

const bigInt = require('big-integer');
let value    = bigInt(2).pow(256);

console.log(value.toString());
// 115792089237316195423570985008687907853269984665640564039457584007913129639936

Post a Comment for "2 ** 256 Biginteger In Javascript"