mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-16 18:56:54 +02:00
fix bug in pack_float and pack_double
This commit is contained in:
@@ -1143,7 +1143,7 @@ inline packer<Stream>& packer<Stream>::pack_float(float d)
|
||||
if(d >= 0 && d <= float(std::numeric_limits<uint64_t>::max()) && d == float(uint64_t(d))) {
|
||||
pack_imp_uint64(uint64_t(d));
|
||||
return *this;
|
||||
} else if(d >= float(std::numeric_limits<int64_t>::min()) && d == float(int64_t(d))) {
|
||||
} else if(d < 0 && d >= float(std::numeric_limits<int64_t>::min()) && d == float(int64_t(d))) {
|
||||
pack_imp_int64(int64_t(d));
|
||||
return *this;
|
||||
}
|
||||
@@ -1165,7 +1165,7 @@ inline packer<Stream>& packer<Stream>::pack_double(double d)
|
||||
if(d >= 0 && d <= double(std::numeric_limits<uint64_t>::max()) && d == double(uint64_t(d))) {
|
||||
pack_imp_uint64(uint64_t(d));
|
||||
return *this;
|
||||
} else if(d >= double(std::numeric_limits<int64_t>::min()) && d == double(int64_t(d))) {
|
||||
} else if(d < 0 && d >= double(std::numeric_limits<int64_t>::min()) && d == double(int64_t(d))) {
|
||||
pack_imp_int64(int64_t(d));
|
||||
return *this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user