Hacker News new | ask | show | jobs
by adolph 811 days ago
How does it handle exponent notation?

https://news.ycombinator.com/item?id=36027871

1 comments

It 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.