1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00
This commit is contained in:
chenguoping
2020-05-15 17:35:43 +08:00
parent e175150f5b
commit 779a0ec7df
3 changed files with 61 additions and 3 deletions

View File

@ -12143,7 +12143,8 @@ class binary_writer
}
else
{
if (j.m_value.number_float < std::numeric_limits<float>::max() and
if (j.m_value.number_float > -std::numeric_limits<float>::min() and
j.m_value.number_float < std::numeric_limits<float>::max() and
static_cast<double>(static_cast<float>(j.m_value.number_float)) == j.m_value.number_float)
{
oa->write_character(get_cbor_float_prefix(static_cast<float>(j.m_value.number_float)));