Open ganeshkbhat opened 1 year ago
If you get the Maximum BigInt size exceeded
error, that means you have exceeded the memory limitations. It seems that the V8 engine only allows up to one billion bits (see https://github.com/tc39/proposal-bigint/issues/174#issuecomment-437471065).
bigInt("3").pow("3005301647874556767787878788787")
is an extremely huge number, so I would expect node.js to hang while it spends its time calculating. Even if there were no memory limitations, I'm not sure I would expect to get the result within the span of a human lifetime.
I am trying this
var n = bigInt("3").pow("300530164787").minus("3").isDivisibleBy("300530164787");
andvar n = bigInt("3").pow("3005301647874556767787878788787").minus("3").isDivisibleBy("3005301647874556767787878788787");
andbigRat(3).pow("300530164787").subtract(3).isDivisibleBy("300530164787")
the node console is all locked up.I am expecting the above to check if
isDivisibleBy(value)
returns an absolute integer and not a float.300530164787%1 === 0
and300530164787.234%1 === 0.234
orvalue%1 === 0
It also throws an error :