• Niels Lohmann's avatar
    💥 implemented new handling of NaN and INF #70 #329 #388 · 8feaf8dc
    Niels Lohmann authored
    - If an overflow occurs during parsing a number from a JSON text, an
    exception (std::out_of_range for the moment, to be replaced by a
    user-defined exception #244) is thrown so that the overflow is detected
    early and roundtripping is guaranteed.
    - NaN and INF floating-point values can be stored in a JSON value and
    are not replaced by null. That is, the basic_json class behaves like
    double in this regard (no exception occurs). However, NaN and INF are
    serialized to “null”.
    - Adjusted test cases appropriately.
    8feaf8dc
unit-regression.cpp 30.6 KB