I am working in javascript and mongo. I have to store and work with very large integers e.g. pow(10,30)
maybe even more. I am concerned about overflowing, does this happen in mongo or in javascript if I use var ? I know that JS function toPrecision()
works up to 20 digits, but what happens if I have more ? And what about mongo, when does the stored number overflow ?
Asked
Active
Viewed 38 times
0

slezadav
- 6,104
- 7
- 40
- 61
-
Maybe this will help? http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-highest-integer-value-a-number-can-go-t – BenM Mar 19 '13 at 10:35
-
You'll need to use a math library and store numbers as strings or as separate components of a larger number. I don't understand your question about use of `var` though. – WiredPrairie Mar 19 '13 at 11:02