@@ -1138,13 +1138,12 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_long_long(unsigned long lon
11381138template <typename Stream>
11391139inline packer<Stream>& packer<Stream>::pack_float (float d)
11401140{
1141- if (d == d) { // check for nan
1142- // compare d to limits::max() to avoid undefined behaviour
1143- if (d >= 0 && d <= std::numeric_limits<uint64_t >::max () && d == uint64_t (d)) {
1141+ if (d == d) { // check for nan
1142+ // compare d to limits to avoid undefined behaviour
1143+ if (d >= 0 && d <= std::numeric_limits<uint64_t >::max () && d == uint64_t (d)) {
11441144 pack_imp_uint64 (uint64_t (d));
1145- return *this ;
1146-
1147- } else if (d >= std::numeric_limits<int64_t >::min () && d == int64_t (d)) {
1145+ return *this ;
1146+ } else if (d >= std::numeric_limits<int64_t >::min () && d == int64_t (d)) {
11481147 pack_imp_int64 (int64_t (d));
11491148 return *this ;
11501149 }
@@ -1161,13 +1160,12 @@ inline packer<Stream>& packer<Stream>::pack_float(float d)
11611160template <typename Stream>
11621161inline packer<Stream>& packer<Stream>::pack_double (double d)
11631162{
1164- if (d == d) { // check for nan
1165- // compare d to limits::max() to avoid undefined behaviour
1166- if (d >= 0 && d <= std::numeric_limits<uint64_t >::max () && d == uint64_t (d)) {
1163+ if (d == d) { // check for nan
1164+ // compare d to limits to avoid undefined behaviour
1165+ if (d >= 0 && d <= std::numeric_limits<uint64_t >::max () && d == uint64_t (d)) {
11671166 pack_imp_uint64 (uint64_t (d));
1168- return *this ;
1169-
1170- } else if (d >= std::numeric_limits<int64_t >::min () && d == int64_t (d)) {
1167+ return *this ;
1168+ } else if (d >= std::numeric_limits<int64_t >::min () && d == int64_t (d)) {
11711169 pack_imp_int64 (int64_t (d));
11721170 return *this ;
11731171 }
0 commit comments