summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/s_roundf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_roundf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_roundf.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sysdeps/ieee754/flt-32/s_roundf.c b/sysdeps/ieee754/flt-32/s_roundf.c
index a75d98f384..7c95125d9c 100644
--- a/sysdeps/ieee754/flt-32/s_roundf.c
+++ b/sysdeps/ieee754/flt-32/s_roundf.c
@@ -1,5 +1,5 @@
/* Round float to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,7 @@
#include <math.h>
#include <math_private.h>
-
-
-static const float huge = 1.0e30;
+#include <libm-alias-float.h>
float
@@ -36,21 +34,17 @@ __roundf (float x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= 0x80000000;
if (j0 == -1)
i0 |= 0x3f800000;
}
else
{
- u_int32_t i = 0x007fffff >> j0;
+ uint32_t i = 0x007fffff >> j0;
if ((i0 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += 0x00400000 >> j0;
i0 &= ~i;
}
@@ -67,4 +61,4 @@ __roundf (float x)
SET_FLOAT_WORD (x, i0);
return x;
}
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)