diff options
author | miloyip <miloyip@gmail.com> | 2014-09-15 12:53:57 +0400 |
---|---|---|
committer | miloyip <miloyip@gmail.com> | 2014-09-15 12:53:57 +0400 |
commit | 50fc3fedb2e09445f5214432387767c84e562805 (patch) | |
tree | 7e61c155e4d0449de2d151c015fd461112834066 | |
parent | b29acfb90d1f8714d721e2e322eb349cfca04ccc (diff) |
Fix round towards even
-rw-r--r-- | include/rapidjson/internal/strtod.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rapidjson/internal/strtod.h b/include/rapidjson/internal/strtod.h index 939cadbc..9c4b20df 100644 --- a/include/rapidjson/internal/strtod.h +++ b/include/rapidjson/internal/strtod.h @@ -477,7 +477,7 @@ inline double FullPrecision(double d, int p, const char* decimals, size_t length else if (cmp == 0) { // Round towards even if (approx.Significand() & 1) - return approx.NextDouble(); + return adjustToNegative ? approx.PreviousDouble() : approx.NextDouble(); else return approx.Value(); } |