Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2020-09-25 22:55:46


On Fri, Sep 25, 2020 at 3:53 PM Andrzej Krzemienski <akrzemi1_at_[hidden]> wrote:
>> I am actually now starting to wonder if even 64-bit integer support
>> was a good idea, as it can produce numbers which most implementations
>> cannot read with perfect fidelity.
>> ...
> 1. Parse losslessly every value produced by rapidjson.
> 2. Generate only values parsable by losslessly JavaScript JSON libraries.
>
> So, I guess the choice made in Boost.JSON is the good one. You will potentially
> produce values not parsable by some JSON libraries, and if goal 2 is important
> for some use cases the user has to make sure that she is only putting doubles
> as numbers.

Thanks for the kind words.

So, I think at some point I will want to introduce options for
serialization, and one of the options could be the treatment of
integers outside the range ~+/-2^53. We could:

1. serialize them as-is (current implementation)
2. serialize them as the nearest representable IEEE double
3. throw an exception

I know some people might find #3 weird, I'm open to feedback.

Regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk