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

Merge branch 'feature/issue329' into develop

This commit is contained in:
Niels
2016-11-02 16:59:23 +01:00
4 changed files with 21 additions and 1 deletions

View File

@ -8257,6 +8257,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