From c036f3db9c9efb78c25331ed42b51e9c40a30df8 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 26 Oct 2020 16:07:16 -0400 Subject: [PATCH] Fix implicit floating-point conversion warnings --- include/boost/json/value.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;