Added ARDUINOJSON_ENABLE_NAN to enable NaN in JSON (closes #973)

This commit is contained in:
Benoit Blanchon
2019-05-18 12:15:36 +02:00
parent 90c1d549a8
commit 7427888e05
8 changed files with 72 additions and 4 deletions

View File

@ -71,8 +71,9 @@ inline ParsedNumber<TFloat, TUInt> parseNumber(const char *s) {
s++;
break;
}
#if ARDUINOJSON_ENABLE_NAN
if (*s == 'n' || *s == 'N') return traits::nan();
#endif
if (*s == 'i' || *s == 'I')
return is_negative ? -traits::inf() : traits::inf();
if (!isdigit(*s) && *s != '.') return return_type();