[PATCH v4 13/21] math: Remove the SVID error handling from atan2f
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Fri Oct 31 13:27:11 GMT 2025
Hi Adhemerval,
- return asdouble (t);
+ double r = asdouble (t);
+ float rf = r;
+ if (__glibc_unlikely (fabsf (rf) < 0x1p-126f))
+ __set_errno (ERANGE);
+ return rf;
}
We should only set errno on underflow to zero - it's more efficient to
test for zero 'rf' as well.
Also, it's better to use __math_uflowf rather than explicitly setting errno.
This shows we're dealing with underflow but also allows us to build with
errno turned off.
Cheers,
Wilco
More information about the Libc-alpha
mailing list