about summary refs log tree commit diff
path: root/math/s_csqrtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_csqrtf.c')
-rw-r--r--math/s_csqrtf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/math/s_csqrtf.c b/math/s_csqrtf.c
index f7dc3b1cd1..e433f476c2 100644
--- a/math/s_csqrtf.c
+++ b/math/s_csqrtf.c
@@ -148,6 +148,17 @@ __csqrtf (__complex__ float x)
 	      s = __scalbnf (s, scale);
 	    }
 
+	  if (fabsf (r) < FLT_MIN)
+	    {
+	      float force_underflow = r * r;
+	      math_force_eval (force_underflow);
+	    }
+	  if (fabsf (s) < FLT_MIN)
+	    {
+	      float force_underflow = s * s;
+	      math_force_eval (force_underflow);
+	    }
+
 	  __real__ res = r;
 	  __imag__ res = __copysignf (s, __imag__ x);
 	}