2009-02-20 08:46:43 +01:00
|
|
|
|
|
|
|
This fixes ceil (x) for -1.0 < x < 0.
|
|
|
|
|
2009-11-16 09:54:19 +01:00
|
|
|
Index: sysdeps/x86_64/fpu/s_ceil.c
|
|
|
|
===================================================================
|
|
|
|
--- sysdeps/x86_64/fpu/s_ceil.c.orig
|
|
|
|
+++ sysdeps/x86_64/fpu/s_ceil.c
|
|
|
|
@@ -34,7 +34,11 @@ double __ceil(double x)
|
2009-02-20 08:46:43 +01:00
|
|
|
/* x is +zero or -zero; return the same zero */
|
|
|
|
return x;
|
|
|
|
else if (xneg) /* x < 0.0 */
|
|
|
|
- return 0.0;
|
|
|
|
+ {
|
|
|
|
+ /* Return zero with the sign of x */
|
|
|
|
+ PUT_BITS_DP64(SIGNBIT_DP64, x);
|
|
|
|
+ return x;
|
|
|
|
+ }
|
|
|
|
else
|
|
|
|
return 1.0;
|
|
|
|
}
|
2009-11-16 09:54:19 +01:00
|
|
|
Index: sysdeps/x86_64/fpu/s_ceilf.c
|
|
|
|
===================================================================
|
|
|
|
--- sysdeps/x86_64/fpu/s_ceilf.c.orig
|
|
|
|
+++ sysdeps/x86_64/fpu/s_ceilf.c
|
|
|
|
@@ -34,7 +34,11 @@ float __ceilf(float x)
|
2009-02-20 08:46:43 +01:00
|
|
|
/* x is +zero or -zero; return the same zero */
|
|
|
|
return x;
|
|
|
|
else if (xneg) /* x < 0.0 */
|
|
|
|
- return 0.0F;
|
|
|
|
+ {
|
|
|
|
+ /* Return zero with the sign of x */
|
|
|
|
+ PUT_BITS_SP32(SIGNBIT_SP32, x);
|
|
|
|
+ return x;
|
|
|
|
+ }
|
|
|
|
else
|
|
|
|
return 1.0F;
|
|
|
|
}
|