Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiloyip <miloyip@gmail.com>2014-09-15 12:53:57 +0400
committermiloyip <miloyip@gmail.com>2014-09-15 12:53:57 +0400
commit50fc3fedb2e09445f5214432387767c84e562805 (patch)
tree7e61c155e4d0449de2d151c015fd461112834066
parentb29acfb90d1f8714d721e2e322eb349cfca04ccc (diff)
Fix round towards even
-rw-r--r--include/rapidjson/internal/strtod.h2
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();
}