Bug 258

Summary: powl problems
Product: glibc Reporter: Ronald Barrett <ronaldbrt>
Component: mathAssignee: Andreas Jaeger <aj>
Status: RESOLVED FIXED    
Severity: normal CC: glibc-bugs
Priority: P2 Flags: fweimer: security-
Version: 2.3.2   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Ronald Barrett 2004-07-08 12:55:35 UTC
x.c:
#include <math.h>
#include <stdio.h>

int main(void){
 printf("inf = %Lg\n", powl(3.43646e+4928l, 3.43646e+4928l));
 printf("0 = %Lg\n", powl(10.0l, -1.1807237520575617777e+4932l));
 
 return 0;
}

gcc x.c -lm -o x && ./x
inf = nan
0 = nan
Comment 1 Petter Reinholdtsen 2004-07-23 09:30:44 UTC
I tried compiling this source on Solaris 8, but it fail to link because the
powl symbol is missing.  Not sure why.  There is no manual page, so I had a
look in the POSIX standard available on the web.  The powl() function is
documented there at
<URL: http://www.opengroup.org/onlinepubs/009695399/functions/pow.html >.

The code did compile and link on Tru64 Unix V5.1A, and gave this result:

% uname -a
OSF1 snape.uio.no V5.1 1885 alpha
% cc-wrapper x.c  -lm; ./a.out
inf = 1.18973e+4932
0 = 0
%
Comment 2 Jakub Jelinek 2004-07-23 13:38:06 UTC
Fixed in CVS on Jun, 19th.