about summary refs log tree commit diff
path: root/math/s_csqrtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_csqrtl.c')
-rw-r--r--math/s_csqrtl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/math/s_csqrtl.c b/math/s_csqrtl.c
index 10988ba6ac..a0252e644a 100644
--- a/math/s_csqrtl.c
+++ b/math/s_csqrtl.c
@@ -104,10 +104,10 @@ __csqrtl (__complex__ long double x)
 		__real__ x = 0.0L;
 	      __imag__ x = __scalbnl (__imag__ x, -2 * scale);
 	    }
-	  else if (fabsl (__real__ x) < LDBL_MIN
-		   && fabsl (__imag__ x) < LDBL_MIN)
+	  else if (fabsl (__real__ x) < 2.0L * LDBL_MIN
+		   && fabsl (__imag__ x) < 2.0L * LDBL_MIN)
 	    {
-	      scale = -(LDBL_MANT_DIG / 2);
+	      scale = -((LDBL_MANT_DIG + 1) / 2);
 	      __real__ x = __scalbnl (__real__ x, -2 * scale);
 	      __imag__ x = __scalbnl (__imag__ x, -2 * scale);
 	    }