This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Bug is recent math library changes
- From: Jeff Law <jeffreyalaw at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 14 Jun 2012 00:28:08 -0600
- Subject: Bug is recent math library changes
This code:
/* compile with 'gcc -o powtest powtest.c -lm' */
#include <math.h>
#include <stdio.h>
int main()
{
double x = pow(0.0, -INFINITY);
printf("pow(0.0, -INFINITY) = %g (positive? %d)\n", x, x>0.0);
return 0;
}
Is currently not handled correctly by the trunk.
F9.4.4 states
pow (x, -INF) returns +INF when abs (x) < 1
However, with the head of the glibc trunk we're currently return -INF
for this case.
Git bisect blames this change:
commit 2460d3aa21f04cdf28497683bd3e29183189f779
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Mar 21 12:14:57 2012 +0000
Fix pow of zero and infinity to large powers.