mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-28 20:15:24 +08:00
ws
This commit is contained in:
parent
a70b00750d
commit
236db83742
@ -81,23 +81,15 @@ std::string valueToString(double value) {
|
||||
len = sprintf_s(buffer, sizeof(buffer), "%.16g", value);
|
||||
#endif
|
||||
#else
|
||||
if ( isfinite( value ))
|
||||
{
|
||||
if (isfinite( value )) {
|
||||
len = snprintf(buffer, sizeof(buffer), "%.16g", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// IEEE standard states that NaN values will not compare to themselves
|
||||
if ( value != value)
|
||||
{
|
||||
if ( value != value) {
|
||||
len = snprintf(buffer, sizeof(buffer), "null");
|
||||
}
|
||||
else if ( value < 0)
|
||||
{
|
||||
} else if ( value < 0) {
|
||||
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
len = snprintf(buffer, sizeof(buffer), "1e+9999");
|
||||
}
|
||||
// For those, we do not need to call fixNumLoc, but it is fast.
|
||||
|
Loading…
x
Reference in New Issue
Block a user