diff --git a/include/boost/json/value.hpp b/include/boost/json/value.hpp index e1bf1001..5c08f01b 100644 --- a/include/boost/json/value.hpp +++ b/include/boost/json/value.hpp @@ -2453,8 +2453,10 @@ public: else if(sca_.k == json::kind::double_) { auto const d = sca_.d; - if( d > (std::numeric_limits::max)() || - d < (std::numeric_limits::min)() || + if( d > static_cast( + (std::numeric_limits::max)()) || + d < static_cast( + (std::numeric_limits::min)()) || static_cast(d) != d) { ec = error::not_exact; @@ -2509,7 +2511,8 @@ public: { auto const d = sca_.d; if( d < 0 || - d > (std::numeric_limits::max)() || + d > static_cast( + (std::numeric_limits::max)()) || static_cast(d) != d) { ec = error::not_exact;