I have recently found the bignumber.js
library:
source: https://github.com/MikeMcl/bignumber.js
What I'm not sure of is if there is a limit to how big the number operations can be? I have been looking into the documentation, trying to find sources online. But nothing as of yet.
If you run this:
You can see that numbers are stored as arrays, of maximum 14 digits
So the actual limitation would be the maximum length you can have for an array, multiplied by 14. This depends a lot on your machine, but assuming you have the best machine ever, ECMA-262 v6.0 says the limit is for the length of an array is
2^32-1
, which is the size of ToUint32, so, theoretically, you could store a number with14 * (2^32-1)
digits using that library, that's something like:Which is something around
60129542130
digits