diff options
Diffstat (limited to 'lib/msun/src/s_roundf.c')
-rw-r--r-- | lib/msun/src/s_roundf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/msun/src/s_roundf.c b/lib/msun/src/s_roundf.c index a7a3da9..952e8e7 100644 --- a/lib/msun/src/s_roundf.c +++ b/lib/msun/src/s_roundf.c @@ -38,14 +38,14 @@ roundf(float x) return (x); if (x >= 0.0) { - t = ceilf(x); - if (t - x > 0.5) - t -= 1.0; + t = floorf(x); + if (t - x <= -0.5) + t += 1.0; return (t); } else { - t = ceilf(-x); - if (t + x > 0.5) - t -= 1.0; + t = floorf(-x); + if (t + x <= -0.5) + t += 1.0; return (-t); } } |