summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/k_tanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/k_tanf.c')
-rw-r--r--sysdeps/ieee754/flt-32/k_tanf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/ieee754/flt-32/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c
index a67f36e283..9f0e55860f 100644
--- a/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/sysdeps/ieee754/flt-32/k_tanf.c
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: k_tanf.c,v 1.4 1995/05/10 20:46:39 jtc Exp $";
#endif
+#include <float.h>
#include <math.h>
#include <math_private.h>
static const float
@@ -48,7 +49,13 @@ float __kernel_tanf(float x, float y, int iy)
if(ix<0x39000000) /* x < 2**-13 */
{if((int)x==0) { /* generate inexact */
if((ix|(iy+1))==0) return one/fabsf(x);
- else return (iy==1)? x: -one/x;
+ else if (iy == 1)
+ {
+ math_check_force_underflow (x);
+ return x;
+ }
+ else
+ return -one / x;
}
}
if(ix>=0x3f2ca140) { /* |x|>=0.6744 */