diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index be0d9fb..8989e38 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -967,13 +967,13 @@ private: else { if (use64bit) { if (minus) - cont = handler.Int64(-(int64_t)i64); + cont = handler.Int64(static_cast(~i64 + 1)); else cont = handler.Uint64(i64); } else { if (minus) - cont = handler.Int(-(int)i); + cont = handler.Int(static_cast(~i + 1)); else cont = handler.Uint(i); }