about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_sinf.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2017-12-05 18:09:22 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2017-12-05 18:09:22 +0000
commit00d54af7c86cdcabc18c00619c229f49f4978610 (patch)
tree6bc09f21632f62fc82f9f5b057e4fa9493adf3ca /sysdeps/ieee754/flt-32/s_sinf.c
parent1f70eae4cf0ca826ddbc2b61720e8aeae1e13de4 (diff)
downloadglibc-00d54af7c86cdcabc18c00619c229f49f4978610.tar.gz
glibc-00d54af7c86cdcabc18c00619c229f49f4978610.tar.xz
glibc-00d54af7c86cdcabc18c00619c229f49f4978610.zip
[PATCH] fix sinf(NAN)
sinf(NAN) should not signal invalid fp exception
so use isless instead of < where NAN is compared.

this makes the sinf tests pass on aarch64.

	* sysdeps/ieee754/flt-32/s_sinf.c (sinf): Use isless.
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_sinf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_sinf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/ieee754/flt-32/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c
index 0b76477d22..8b98573ae4 100644
--- a/sysdeps/ieee754/flt-32/s_sinf.c
+++ b/sysdeps/ieee754/flt-32/s_sinf.c
@@ -128,7 +128,7 @@ SINF_FUNC (float x)
   double theta = x;
   double abstheta = fabs (theta);
   /* If |x|< Pi/4.  */
-  if (abstheta < M_PI_4)
+  if (isless (abstheta, M_PI_4))
     {
       if (abstheta >= 0x1p-5) /* |x| >= 2^-5.  */
 	{
@@ -162,8 +162,8 @@ SINF_FUNC (float x)
     }
   else                          /* |x| >= Pi/4.  */
     {
-      unsigned int signbit = (x < 0);
-      if (abstheta < 9 * M_PI_4)        /* |x| < 9*Pi/4.  */
+      unsigned int signbit = isless (x, 0);
+      if (isless (abstheta, 9 * M_PI_4))        /* |x| < 9*Pi/4.  */
 	{
 	  /* There are cases where FE_UPWARD rounding mode can
 	     produce a result of abstheta * inv_PI_4 == 9,