On Sat, Mar 23, 2013 at 09:15:58PM -0700, Sisyphus wrote: > I don't know if this bug was present in 5.17.9 (and/or earlier). > It affects only my 64-bit build of 5.17.10. My 32-bit builds, > including the 64int build, are fine. > > Perl correctly evaluates 2**1e15 as infinity. > But it evaluates 2**1e16 as 0. For exponents greater than 16, 0 > is also returned. (This shows up in one of the > t/op/sprintf2.t tests as a 'divide-by-zero' error.) The actual maths should be hitting this rather simple bit of pp.c: #else SETn( Perl_pow( left, right) ); #endif /* HAS_AIX_POWL_NEG_BASE_BUG */ so the question is, does it end up somewhere else? Or does it get there, but the C runtime is the problem? If you compile a C program with the same compiler flags as perl was built with, do you get the same results? ie #include <math.h> #include <stdio.h> int main (int argc, char **argv) { double power = 1e16; printf("2**%g = %g\n", power, pow(2, power)); return 0; } > Compiler: > cc='x86_64-w64-mingw32-gcc', ccflags > =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT > -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields', > optimize='-s -O2', Nicholas ClarkThread Previous | Thread Next