style changes

This commit is contained in:
GeorgFritze
2022-06-03 15:08:23 +02:00
parent 3b405fcab3
commit d5c837b612

View File

@@ -1139,11 +1139,10 @@ template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_float(float d)
{
if(d == d) { // check for nan
// compare d to limits::max() to avoid undefined behaviour
// compare d to limits to avoid undefined behaviour
if(d >= 0 && d <= std::numeric_limits<uint64_t>::max() && d == uint64_t(d)) {
pack_imp_uint64(uint64_t(d));
return *this;
} else if(d >= std::numeric_limits<int64_t>::min() && d == int64_t(d)) {
pack_imp_int64(int64_t(d));
return *this;
@@ -1162,11 +1161,10 @@ template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_double(double d)
{
if(d == d) { // check for nan
// compare d to limits::max() to avoid undefined behaviour
// compare d to limits to avoid undefined behaviour
if(d >= 0 && d <= std::numeric_limits<uint64_t>::max() && d == uint64_t(d)) {
pack_imp_uint64(uint64_t(d));
return *this;
} else if(d >= std::numeric_limits<int64_t>::min() && d == int64_t(d)) {
pack_imp_int64(int64_t(d));
return *this;