This commit is contained in:
nlohmann
2026-07-09 16:04:09 +00:00
parent a72084fa16
commit c9c3d3de86
308 changed files with 423 additions and 309 deletions
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -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