diff options
Diffstat (limited to 'lib/msun/src/s_round.c')
-rw-r--r-- | lib/msun/src/s_round.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/msun/src/s_round.c b/lib/msun/src/s_round.c index 34b26f0..65de31b 100644 --- a/lib/msun/src/s_round.c +++ b/lib/msun/src/s_round.c @@ -38,14 +38,14 @@ round(double x) return (x); if (x >= 0.0) { - t = ceil(x); - if (t - x > 0.5) - t -= 1.0; + t = floor(x); + if (t - x <= -0.5) + t += 1.0; return (t); } else { - t = ceil(-x); - if (t + x > 0.5) - t -= 1.0; + t = floor(-x); + if (t + x <= -0.5) + t += 1.0; return (-t); } } |