> On Wed, Jan 17, 2001 at 03:16:43PM +0100, Roca, Ignasi wrote: > > There is a bug in pp_int() function that has a bad influence in the wrap > > method of Tie::Substrhash > > > > Try following perl-script: > > > > $t0 = 279964589018079; > > > > $t1 = int($t0 / 59); > > print "int($t0/59)=$t1\n"; > > > > The result is > > int(279964589018079/59)=4745162525730.15 > > > > As you can see result is not an integer. > > Wow, there's definitely a bug in there, though I see it a little > bit differently: > > ./perl -le 'print int(279964589018079/59)' > > Attempt to free unreferenced scalar. > > mimosa being a Solaris/sparc box. > > (Note that 279964589018079 is large enough to overflow 32 bits, > so in the general case you really shouldn't assume that you get > any accurate results from the division, though.) > With ./perl -le 'print int(279964589018079/59)' in posix-bc I have also the "Attempt to free unreferenced scalar" message. But with the above script is runs, and with the patch the result is OK. > > Following is a patch to correct the bug > > =============================================== > > --- pp.c.orig Tue Jan 9 05:14:45 2001 > > +++ pp.c Wed Jan 17 15:10:30 2001 > > @@ -2593,6 +2593,7 @@ > > (void)Perl_modf(tmp, &tmp); > > value = (NV)tmp; > > #endif > > + SETn(value); > > Thanks, applied. > > > } > > } > > else { > > =============================================== > > > > -- Ignasi Roca > > -- > $jhi++; # http://www.iki.fi/jhi/ > # There is this special biologist word we use for 'stable'. > # It is 'dead'. -- Jack CohenThread Previous | Thread Next