mirror of
https://github.com/nlohmann/json.git
synced 2026-07-10 12:35:09 +00:00
deploy: 521a084827
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -64,7 +64,11 @@ The following values can **not** be converted to a MessagePack value:
|
||||
|
||||
NaN/infinity handling
|
||||
|
||||
If NaN or Infinity are stored inside a JSON number, they are serialized properly in contrast to the [dump](https://json.nlohmann.me/api/basic_json/dump/index.md) function which serializes NaN or Infinity to `null`.
|
||||
`NaN`, `Infinity`, and `-Infinity` are serialized as a MessagePack float 32 (type 0xCA, 5 bytes total), regardless of magnitude, in contrast to the [dump](https://json.nlohmann.me/api/basic_json/dump/index.md) function which serializes NaN or Infinity to `null`.
|
||||
|
||||
Note
|
||||
|
||||
Prior to version 3.13.0, NaN and Infinity were instead serialized as a MessagePack float 64 (type 0xCB, 9 bytes total), because the check used to select the smaller float 32 encoding compared magnitudes with NaN, which is always `false` and caused the float 32 path to be skipped.
|
||||
|
||||
Example
|
||||
|
||||
|
||||
Reference in New Issue
Block a user