javascript - How do you store a googol in the database (and other very large numbers)? -
how efficiently store large , small numbers 10^-100 10^100, can use them calculate values in programming language javascript.
javascript stores 10^100 1e+101, there way in database? numbers not large, calculations data such 10^-34 * 2^16 or whatever, database should (i think) storing these numbers...
how work? how store numbers of scale such can run computations them?
by "the database", i'm thinking in general. messing around mongodb , neo4j currently.
databases don't support numbers of arbitrary size in native numeric format. general upper limit on numeric types 8 bytes, isn't anywhere near googol.
you'll have store number either string (least efficient, easiest work with, can precise needed), byte array of arbitrary length (more efficient, harder work with, still arbitrary precision), or in scientific notation (most efficient, harder work with, , limited precision).
the first two, unfortunately, eliminate possibility of doing server-side computation, since there wouldn't native numeric type support range of valid values. of computation have done client-side using suitable numeric type.
Comments
Post a Comment