mirror of
https://github.com/boostorg/json.git
synced 2025-05-12 06:01:41 +00:00
Fix implicit floating-point conversion warnings
This commit is contained in:
parent
e330361ded
commit
c036f3db9c
@ -2453,8 +2453,10 @@ public:
|
||||
else if(sca_.k == json::kind::double_)
|
||||
{
|
||||
auto const d = sca_.d;
|
||||
if( d > (std::numeric_limits<T>::max)() ||
|
||||
d < (std::numeric_limits<T>::min)() ||
|
||||
if( d > static_cast<double>(
|
||||
(std::numeric_limits<T>::max)()) ||
|
||||
d < static_cast<double>(
|
||||
(std::numeric_limits<T>::min)()) ||
|
||||
static_cast<T>(d) != d)
|
||||
{
|
||||
ec = error::not_exact;
|
||||
@ -2509,7 +2511,8 @@ public:
|
||||
{
|
||||
auto const d = sca_.d;
|
||||
if( d < 0 ||
|
||||
d > (std::numeric_limits<T>::max)() ||
|
||||
d > static_cast<double>(
|
||||
(std::numeric_limits<T>::max)()) ||
|
||||
static_cast<T>(d) != d)
|
||||
{
|
||||
ec = error::not_exact;
|
||||
|
Loading…
x
Reference in New Issue
Block a user