summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_floor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_floor.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_floor.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_floor.c b/sysdeps/ieee754/dbl-64/s_floor.c
index bd6afa72e8..f27c6f3ad2 100644
--- a/sysdeps/ieee754/dbl-64/s_floor.c
+++ b/sysdeps/ieee754/dbl-64/s_floor.c
@@ -15,27 +15,24 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__floor (double x)
{
int32_t i0, i1, j0;
- u_int32_t i, j;
+ uint32_t i, j;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (j0 < 20)
{
- if (j0 < 0) /* raise inexact if x != 0 */
+ if (j0 < 0)
{
- math_force_eval (huge + x); /* return 0*sign(x) if |x|<1 */
+ /* return 0*sign(x) if |x|<1 */
if (i0 >= 0)
{
i0 = i1 = 0;
@@ -50,7 +47,6 @@ __floor (double x)
i = (0x000fffff) >> j0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
i0 += (0x00100000) >> j0;
i0 &= (~i); i1 = 0;
@@ -65,10 +61,9 @@ __floor (double x)
}
else
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
{
if (j0 == 20)
@@ -87,9 +82,5 @@ __floor (double x)
return x;
}
#ifndef __floor
-weak_alias (__floor, floor)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-# endif
+libm_alias_double (__floor, floor)
#endif