diff --git a/Road-toward-3.0.0.md b/Road-toward-3.0.0.md index 8eba87d..ed5b4a1 100644 --- a/Road-toward-3.0.0.md +++ b/Road-toward-3.0.0.md @@ -47,4 +47,10 @@ or ```cpp json j; ss >> j; -``` \ No newline at end of file +``` + +## Handling of NaN and INF + +- 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) 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”.