[PATCH v4 09/21] math: Remove the SVID error handling from lgammaf/lgammaf_r
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Oct 31 13:03:41 GMT 2025
On 29/10/25 17:03, Wilco Dijkstra wrote:
> 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?
It is complete bogus, and __math_oflowf is suffice here. Thanks!
More information about the Libc-alpha
mailing list