mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-09-15 15:13:21 +00:00
fix node::value()
not retrieving inf
and nan
correctly
This commit is contained in:
parent
1ef6c0c6c8
commit
00e080f126
@ -740,7 +740,8 @@ TOML_NAMESPACE_START
|
||||
else
|
||||
{
|
||||
const double val = *ref_cast<double>();
|
||||
if (val < (std::numeric_limits<T>::lowest)() || val > (std::numeric_limits<T>::max)())
|
||||
if (impl::fpclassify(val) == fp_class::ok
|
||||
&& (val < (std::numeric_limits<T>::lowest)() || val > (std::numeric_limits<T>::max)()))
|
||||
return {};
|
||||
return { static_cast<T>(val) };
|
||||
}
|
||||
|
3
toml.hpp
3
toml.hpp
@ -3213,7 +3213,8 @@ TOML_NAMESPACE_START
|
||||
else
|
||||
{
|
||||
const double val = *ref_cast<double>();
|
||||
if (val < (std::numeric_limits<T>::lowest)() || val > (std::numeric_limits<T>::max)())
|
||||
if (impl::fpclassify(val) == fp_class::ok
|
||||
&& (val < (std::numeric_limits<T>::lowest)() || val > (std::numeric_limits<T>::max)()))
|
||||
return {};
|
||||
return { static_cast<T>(val) };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user