diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-25 10:52:45 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-25 10:52:45 -0400 |
commit | d7826aa149d2e85128a7ecf8fadc950ab9fe7a22 (patch) | |
tree | 9aff1638197c1f9b2ed99c8d666bd1a0b42517cb /sysdeps/ieee754/flt-32/s_roundf.c | |
parent | 31ea014d8b09e6aa4f07cdb86c94ce50f1b92c2a (diff) | |
download | glibc-d7826aa149d2e85128a7ecf8fadc950ab9fe7a22.tar glibc-d7826aa149d2e85128a7ecf8fadc950ab9fe7a22.tar.gz glibc-d7826aa149d2e85128a7ecf8fadc950ab9fe7a22.tar.bz2 glibc-d7826aa149d2e85128a7ecf8fadc950ab9fe7a22.zip |
Use math_force_eval in more places
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_roundf.c')
-rw-r--r-- | sysdeps/ieee754/flt-32/s_roundf.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sysdeps/ieee754/flt-32/s_roundf.c b/sysdeps/ieee754/flt-32/s_roundf.c index 0b24987792..09b38cdc2a 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 Free Software Foundation, Inc. + Copyright (C) 1997, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -37,12 +37,11 @@ __roundf (float x) { if (j0 < 0) { - if (huge + x > 0.0F) - { - i0 &= 0x80000000; - if (j0 == -1) - i0 |= 0x3f800000; - } + math_force_eval (huge + x > 0.0F); + + i0 &= 0x80000000; + if (j0 == -1) + i0 |= 0x3f800000; } else { @@ -50,12 +49,11 @@ __roundf (float x) if ((i0 & i) == 0) /* X is integral. */ return x; - if (huge + x > 0.0F) - { - /* Raise inexact if x != 0. */ - i0 += 0x00400000 >> j0; - i0 &= ~i; - } + math_force_eval (huge + x > 0.0F); + + /* Raise inexact if x != 0. */ + i0 += 0x00400000 >> j0; + i0 &= ~i; } } else |