1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-15 07:41:50 +03:00

Merge branch 'develop' into feature/jsontestsuite

This commit is contained in:
Niels
2016-11-02 17:03:12 +01:00
3 changed files with 20 additions and 0 deletions

View File

@ -8270,6 +8270,13 @@ class basic_json
{
// parse with strtod
result.m_value.number_float = str_to_float_t(static_cast<number_float_t*>(nullptr), NULL);
// replace infinity and NAN by null
if (not std::isfinite(result.m_value.number_float))
{
type = value_t::null;
result.m_value = basic_json::json_value();
}
}
// save the type