diff --git a/cpp/type/int.hpp b/cpp/type/int.hpp index 8fdc3866..03500f76 100644 --- a/cpp/type/int.hpp +++ b/cpp/type/int.hpp @@ -37,7 +37,7 @@ namespace detail { { throw type_error(); } return o.via.u64; } else if(o.type == type::NEGATIVE_INTEGER) { - if(o.via.i64 < (int64_t)-std::numeric_limits::max()) + if(o.via.i64 < (int64_t)std::numeric_limits::min()) { throw type_error(); } return o.via.i64; }