summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_ceil.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_ceil.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_ceil.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_ceil.c b/sysdeps/ieee754/dbl-64/s_ceil.c
index b2154b407d..5a7434c737 100644
--- a/sysdeps/ieee754/dbl-64/s_ceil.c
+++ b/sysdeps/ieee754/dbl-64/s_ceil.c
@@ -15,27 +15,23 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__ceil (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 */
if (i0 < 0)
{
@@ -51,7 +47,6 @@ __ceil (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;
@@ -66,10 +61,9 @@ __ceil (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)
@@ -88,9 +82,5 @@ __ceil (double x)
return x;
}
#ifndef __ceil
-weak_alias (__ceil, ceil)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-# endif
+libm_alias_double (__ceil, ceil)
#endif