about summary refs log tree commit diff
path: root/math/s_catanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_catanf.c')
-rw-r--r--math/s_catanf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/math/s_catanf.c b/math/s_catanf.c
index 3ffc6db52c..d0d188ca0b 100644
--- a/math/s_catanf.c
+++ b/math/s_catanf.c
@@ -20,7 +20,7 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
-
+#include <float.h>
 
 __complex__ float
 __catanf (__complex__ float x)
@@ -83,6 +83,17 @@ __catanf (__complex__ float x)
 	  num = 4.0f * __imag__ x;
 	  __imag__ res = 0.25f * __log1pf (num / den);
 	}
+
+      if (fabsf (__real__ res) < FLT_MIN)
+	{
+	  volatile float force_underflow = __real__ res * __real__ res;
+	  (void) force_underflow;
+	}
+      if (fabsf (__imag__ res) < FLT_MIN)
+	{
+	  volatile float force_underflow = __imag__ res * __imag__ res;
+	  (void) force_underflow;
+	}
     }
 
   return res;