3 ms·
How does it handle exponent notation? https://news.ycombinator.com/item?id=36027871 https://news.ycombinator.com/item?id=36027871
by adolph 3y ago
How does it handle exponent notation?
https://news.ycombinator.com/item?id=36027871 https://news.ycombinator.com/item?id=36027871
- kccqzy 3y agoIt just handles it natively. The internal representation is coefficient and exponent. Parsing `1e100` results in storing 1 and 100 separately. That's why parsing huge JSON numbers is not a problem. The problem comes when you do arithmetic on it, which is when it needs to convert the number into the libgmp representation.