On x86, expm1 (1e5) properly returns an infinity with errno set to ERANGE - but does not raise the OVERFLOW exception. On x86_64, OVERFLOW is properly raised. Testcase: #include <errno.h> #include <fenv.h> #include <math.h> #include <stdio.h> #include <float.h> volatile double d = 1e5; int main (void) { feclearexcept (FE_ALL_EXCEPT); errno = 0; volatile double r = expm1 (d); if (fetestexcept (FE_DIVBYZERO)) printf ("DIVBYZERO "); if (fetestexcept (FE_INEXACT)) printf ("INEXACT "); if (fetestexcept (FE_INVALID)) printf ("INVALID "); if (fetestexcept (FE_OVERFLOW)) printf ("OVERFLOW "); if (fetestexcept (FE_UNDERFLOW)) printf ("UNDERFLOW "); printf ("%.18g %m\n", r); return 0; } Result: inf Numerical result out of range
Fixed by: commit 41498f4db1ebfeb2fb76b9137cba38c20000f1d3 Author: Joseph Myers <joseph@codesourcery.com> Date: Sat May 5 19:37:39 2012 +0000 Fix missing exceptions from exp (bugs 13787, 13922, 14036).