File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1138,6 +1138,11 @@ 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 == int64_t (d))
1142+ {
1143+ pack_imp_int64 (int64_t (d));
1144+ return *this ;
1145+ }
11411146 union { float f; uint32_t i; } mem;
11421147 mem.f = d;
11431148 char buf[5 ];
@@ -1149,6 +1154,12 @@ inline packer<Stream>& packer<Stream>::pack_float(float d)
11491154template <typename Stream>
11501155inline packer<Stream>& packer<Stream>::pack_double (double d)
11511156{
1157+ if (d == int64_t (d))
1158+ {
1159+ pack_imp_int64 (int64_t (d));
1160+ return *this ;
1161+ }
1162+
11521163 union { double f; uint64_t i; } mem;
11531164 mem.f = d;
11541165 char buf[9 ];
You can’t perform that action at this time.
0 commit comments