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

@ -194,7 +194,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)));