diff options
author | Joseph Myers <joseph@codesourcery.com> | 2013-04-26 19:26:22 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2013-04-26 19:26:22 +0000 |
commit | 9457fd952cafc701375fc9fae575a4aca1374de3 (patch) | |
tree | 0116832c92205eb0c42197ce9c269a7f52d09c5e /math/s_catanl.c | |
parent | f0302940e7c2acb587971e3c99dfbd00aa4e2134 (diff) | |
download | glibc-9457fd952cafc701375fc9fae575a4aca1374de3.tar glibc-9457fd952cafc701375fc9fae575a4aca1374de3.tar.gz glibc-9457fd952cafc701375fc9fae575a4aca1374de3.tar.bz2 glibc-9457fd952cafc701375fc9fae575a4aca1374de3.zip |
Fix catan, catanh missing underflows (bug 15406).
Diffstat (limited to 'math/s_catanl.c')
-rw-r--r-- | math/s_catanl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/math/s_catanl.c b/math/s_catanl.c index 67b6b52d1d..2440e6d151 100644 --- a/math/s_catanl.c +++ b/math/s_catanl.c @@ -20,7 +20,7 @@ #include <complex.h> #include <math.h> #include <math_private.h> - +#include <float.h> __complex__ long double __catanl (__complex__ long double x) @@ -83,6 +83,17 @@ __catanl (__complex__ long double x) num = 4.0L * __imag__ x; __imag__ res = 0.25L * __log1pl (num / den); } + + if (fabsl (__real__ res) < LDBL_MIN) + { + volatile long double force_underflow = __real__ res * __real__ res; + (void) force_underflow; + } + if (fabsl (__imag__ res) < LDBL_MIN) + { + volatile long double force_underflow = __imag__ res * __imag__ res; + (void) force_underflow; + } } return res; |