justmoon / node-bignum

Big integers for Node.js using OpenSSL
419 stars 116 forks source link

Unexpected behaviour when parsing very large numbers #104

Open dappelt opened 6 years ago

dappelt commented 6 years ago

Observed Behaviour

bignum() does not instantiate very large integers (>= 1e+308) as expected:

bignum(1e+307).toNumber() === 1e+307 // expected
bignum(1e+308).toNumber() === 0 // unexpected

Expected Behaviour

Instantiate a bignum object for very large integers as expected or throw an error if the argument passed to bignum() exceeds a threshold.

Version Info