eglibc-2.10.1/sysdeps/ieee754/dbl-64 e_tan2.c line: 406 calls EMULV in dla.h which overflows test case #include <stdio.h> #include <math.h> #include <float.h> #include <fenv.h> double call_atan2(double x, double y) { volatile double a = x; volatile double b = y; volatile double r = atan2(x, y); return r; } int main(void) { double piby4 = call_atan2(DBL_MAX, DBL_MAX); fexcept_t fe = fetestexcept(FE_OVERFLOW); char *word = fe ? "overflowed" : ""; printf("atan2(%e, %e) => %e %s\n", DBL_MAX, DBL_MAX, piby4, word); return 0; }
Confirmed with current sources on x86_64.
Fixed (both OVERFLOW and INVALID exceptions were wrongly given) by: commit 7726d6a95d5a2c08c8d43186002f040b9b889c27 Author: Joseph Myers <joseph@codesourcery.com> Date: Mon Mar 19 20:11:09 2012 +0000 Fix atan2 spurious exceptions (bug 11451).