Hacker News new | ask | show | jobs
by madmoose 492 days ago
> Fortunately `f64::parse` accepts a strict superset of JSON number grammar

Just for the sake of completeness, and not to imply that you don't know this, but the JSON spec doesn't limit the size or precision of numbers, although it allows implementations set other limits.

I have encountered JSON documents that (annoyingly) required the use of a parser with bigint-support.

1 comments

> but the JSON spec doesn't limit the size or precision of numbers, although it allows implementations set other limits.

This actually led to a data-loss causing bug in the AWS DynamoDB Console's editor a couple of years ago. IIRC, the temporary fix was to fail if the input-number couldn't be represented by a 64-bit float. Can't remember if it ever got a proper fix.