mirror of
https://github.com/nlohmann/json.git
synced 2025-07-29 23:01:16 +03:00
🐛 serialize 32-bit floating-point numbers as float 32 in MessagePack (0xCA) #2196
This commit is contained in:
@ -31,7 +31,8 @@ number_unsigned | 128..255 | uint 8 | 0xCC
|
||||
number_unsigned | 256..65535 | uint 16 | 0xCD
|
||||
number_unsigned | 65536..4294967295 | uint 32 | 0xCE
|
||||
number_unsigned | 4294967296..18446744073709551615 | uint 64 | 0xCF
|
||||
number_float | *any value* | float 64 | 0xCB
|
||||
number_float | *any value representable by a float* | float 32 | 0xCA
|
||||
number_float | *any value NOT representable by a float* | float 64 | 0xCB
|
||||
string | *length*: 0..31 | fixstr | 0xA0..0xBF
|
||||
string | *length*: 32..255 | str 8 | 0xD9
|
||||
string | *length*: 256..65535 | str 16 | 0xDA
|
||||
@ -61,10 +62,6 @@ binary | *size*: 65536..4294967295 | bin 32 | 0xC6
|
||||
- arrays with more than 4294967295 elements
|
||||
- objects with more than 4294967295 elements
|
||||
|
||||
!!! info "Unused MessagePack types"
|
||||
|
||||
The following MessagePack types are not used in the conversion: float 32 (0xCA)
|
||||
|
||||
!!! info "NaN/infinity handling"
|
||||
|
||||
If NaN or Infinity are stored inside a JSON number, they are serialized properly. function which serializes NaN or Infinity to `null`.
|
||||
|
Reference in New Issue
Block a user