[PATCH v4 09/21] math: Remove the SVID error handling from lgammaf/lgammaf_r

Wilco Dijkstra Wilco.Dijkstra@arm.com
Wed Oct 29 20:03:02 GMT 2025


Hi Adhemerval,

 	  if (__glibc_unlikely (x > 0x1.895f1cp+121f))
-	    return math_narrow_eval (0x1p127f * 0x1p127f);
+	    {
+	      float r =  math_narrow_eval (0x1p127f * 0x1p127f);
+	      if (x > 0x1.895f1cp+121f || (x == 0x1.895f1cp+121f &&
+					   x * 5.0f >= 0x1.ebb6e4p+123))
+		return __math_oflowf_value (r);
+	      return r;
+	    }

This looks wrong. It checks x > 0x1.895f1cp+121f twice, and also
checks x == 0x1.895f1cp+121fx, but that can never be true.
So this always calls __math_oflowf_value (r) - in which case why
not use __math_oflowf?

Cheers,
Wilco


More information about the Libc-alpha mailing list