Merge branches 'binary_type' and 'develop' of https://github.com/nlohmann/json into binary_type

This commit is contained in:
Niels Lohmann 2020-05-17 12:27:58 +02:00
commit ab6e76dd05
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
18 changed files with 96 additions and 38 deletions

View file

@ -194,9 +194,9 @@ class binary_writer
}
else
{
if (j.m_value.number_float >= std::numeric_limits<float>::lowest() 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)
if (static_cast<double>(j.m_value.number_float) >= static_cast<double>(std::numeric_limits<float>::lowest()) and
static_cast<double>(j.m_value.number_float) <= static_cast<double>(std::numeric_limits<float>::max()) and
static_cast<double>(static_cast<float>(j.m_value.number_float)) == static_cast<double>(j.m_value.number_float))
{
oa->write_character(get_cbor_float_prefix(static_cast<float>(j.m_value.number_float)));
write_number(static_cast<float>(j.m_value.number_float));

View file

@ -3,7 +3,6 @@
#include <algorithm> // reverse, remove, fill, find, none_of
#include <array> // array
#include <cassert> // assert
#include <ciso646> // and, or
#include <clocale> // localeconv, lconv
#include <cmath> // labs, isfinite, isnan, signbit
#include <cstddef> // size_t, ptrdiff_t
@ -14,6 +13,7 @@
#include <type_traits> // is_same
#include <utility> // move
#include <nlohmann/detail/boolean_operators.hpp>
#include <nlohmann/detail/conversions/to_chars.hpp>
#include <nlohmann/detail/exceptions.hpp>
#include <nlohmann/detail/macro_scope.hpp>