aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2006-01-31 18:56:42 +0000
committerRoland McGrath <roland@gnu.org>2006-01-31 18:56:42 +0000
commit16f0ecedb5726fa46fac6a73b633aabcf469962d (patch)
treeb58989963f24a39fb71398dbf90c8d6f67f9f421 /sysdeps/ieee754/ldbl-128ibm/s_floorl.c
parent27d7e3b54c07b8eff35d2ff07ff9eb8ea03c853e (diff)
downloadglibc-16f0ecedb5726fa46fac6a73b633aabcf469962d.tar
glibc-16f0ecedb5726fa46fac6a73b633aabcf469962d.tar.gz
glibc-16f0ecedb5726fa46fac6a73b633aabcf469962d.tar.bz2
glibc-16f0ecedb5726fa46fac6a73b633aabcf469962d.zip
* sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Correct index
for __sincosl_table. * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl): Likewise. * sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Correct sign of 0.0. * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_cprojl.c: New file. * sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c: New file. * sysdeps/ieee754/ldbl-128ibm/s_ctanl.c: New file.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_floorl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_floorl.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
index e8ef6e849d..2be5e28698 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
@@ -18,9 +18,6 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-/* This has been coded in assembler because GCC makes such a mess of it
- when it's coded in C. */
-
#include <math.h>
#include <fenv.h>
#include <math_ldbl_opt.h>
@@ -44,18 +41,22 @@ __floorl (x)
u.d = x;
if (fabs (u.dd[0]) < TWO52)
- {
+ {
+ double high = u.dd[0];
fesetround(FE_DOWNWARD);
- if (u.dd[0] > 0.0)
+ if (high > 0.0)
{
- u.dd[0] += TWO52;
- u.dd[0] -= TWO52;
+ high += TWO52;
+ high -= TWO52;
+ if (high == -0.0) high = 0.0;
}
- else if (u.dd[0] < 0.0)
+ else if (high < 0.0)
{
- u.dd[0] -= TWO52;
- u.dd[0] += TWO52;
+ high -= TWO52;
+ high += TWO52;
+ if (high == 0.0) high = -0.0;
}
+ u.dd[0] = high;
u.dd[1] = 0.0;
fesetround(mode);
}