Hacker News new | ask | show | jobs
by zeroimpl 1942 days ago
I’m sure they could make stringify work, since numbers in JSON can be arbitrarily large. But parsing JSON and having it return BigInt instead of Number just isn’t going to be able to work by default. I guess because of this, making stringify work without parse support just isn’t desirable.
1 comments

Where do you read numbers can be arbitrarily large? I thought it was limited to javascript numbers.
> Where do you read numbers can be arbitrarily large?

RFC 8259, Section 6, specifies unlimited number of digits for the integer and fraction parts, but allows implementations to have size and precision constraints.

> I thought it was limited to javascript numbers.

It suggest that IEEE754 binary64, because it is widely available and supported, should generally be safely usable (which happens to be exactly JavaScript numbers) but it does not limit JSON numbers to that range/precision.