Bug 13873 - pow (DBL_MAX, DBL_MAX) does not raise overflow exception
Summary: pow (DBL_MAX, DBL_MAX) does not raise overflow exception
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-20 00:51 UTC by Joseph Myers
Modified: 2014-06-26 13:48 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Myers 2012-03-20 00:51:58 UTC
On x86_64, pow (DBL_MAX, DBL_MAX) does not raise the overflow exception.  (This appears to be distinct from the various other open pow bugs).  Testcase:

#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <stdio.h>
#include <float.h>

volatile double d1 = DBL_MAX, d2 = DBL_MAX;

int
main (void)
{
  feclearexcept (FE_ALL_EXCEPT);
  errno = 0;
  volatile double r = pow (d1, d2);
  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;
}
Comment 1 Joseph Myers 2012-04-09 09:47:56 UTC
Fixed by:

commit d7dd94539899466a9a4e38c61ab846ffcb314dad
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Apr 9 09:43:18 2012 +0000

    Fix missing overflow exceptions from pow (bug 13873).