Commit 50fc3fed authored by miloyip's avatar miloyip

Fix round towards even

parent b29acfb9
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment