[PATCH v6 2/3] math: Remove the SVID error handling from atan2f

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Nov 4 20:43:03 GMT 2025


Hi Adhemerval,


-  return asdouble (t);
+  double r = asdouble (t);
+  float rf = r;
+  if (__glibc_unlikely (rf == 0.0f))
+    return __math_uflowf (t >> 63);
+  return rf;

OK
 
 float
-__ieee754_atan2f (float y, float x)
+__atan2f (float y, float x)
 {
   static const double cn[] =
     {
@@ -269,6 +275,16 @@ __ieee754_atan2f (float y, float x)
         }
       r = th + tm;
     }
-  return r;
+  float rf = r;
+  if (__glibc_unlikely (rf == 0.0f))
+    return __math_uflowf (asuint (rf) >> 1);
+  return rf;

OK (note >> 1 is slightly confusing...)

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>

Cheers,
Wilco



More information about the Libc-alpha mailing list