fix ValueTest/specialFloats test failure when fp:fast on msvc

This commit is contained in:
fo40225 2018-05-05 14:38:53 +08:00
parent 02211117f1
commit 3f0d91f08a

View File

@ -149,7 +149,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
} else {
// IEEE standard states that NaN values will not compare to themselves
if (value != value) {
if (isnan(value)) {
len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "NaN" : "null");
} else if (value < 0) {
len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "-Infinity" : "-1e+9999");