Skip to content

Commit 236db83

Browse files
committed
ws
1 parent a70b007 commit 236db83

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

Diff for: src/lib_json/json_writer.cpp

+5-13
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,15 @@ std::string valueToString(double value) {
8181
len = sprintf_s(buffer, sizeof(buffer), "%.16g", value);
8282
#endif
8383
#else
84-
if ( isfinite( value ))
85-
{
84+
if (isfinite( value )) {
8685
len = snprintf(buffer, sizeof(buffer), "%.16g", value);
87-
}
88-
else
89-
{
86+
} else {
9087
// IEEE standard states that NaN values will not compare to themselves
91-
if ( value != value)
92-
{
88+
if ( value != value) {
9389
len = snprintf(buffer, sizeof(buffer), "null");
94-
}
95-
else if ( value < 0)
96-
{
90+
} else if ( value < 0) {
9791
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
98-
}
99-
else
100-
{
92+
} else {
10193
len = snprintf(buffer, sizeof(buffer), "1e+9999");
10294
}
10395
// For those, we do not need to call fixNumLoc, but it is fast.

0 commit comments

Comments
 (0)