mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-14 18:07:56 +08:00
fix ValueTest/specialFloats test failure when fp:fast on msvc
This commit is contained in:
parent
02211117f1
commit
3f0d91f08a
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user