diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 18:56:13 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 18:57:13 +0000 |
commit | 82dd75a7f436a19047325d62182590c9f9e23a78 (patch) | |
tree | 60ca20c8cf2b0d178d84725c0715471f76df97e1 /sysdeps/ieee754/flt-32/s_roundf.c | |
parent | 0bbb676a2342367c4e52b35e890f24667dabb348 (diff) | |
parent | 963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff) |
Merge commit 'refs/top-bases/t/tls' into t/tls
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_roundf.c')
-rw-r--r-- | sysdeps/ieee754/flt-32/s_roundf.c | 14 |
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) |