On Tue, Sep 09, 2003 at 08:41:56AM -0400, Dan Sugalski wrote: > On Tue, 9 Sep 2003, Leopold Toetsch wrote:
> > BTW PerlInt.divide() always yields a PerlNum, this seems bogus to me. > > I think we need some clarification for the PerlNum implementation. > > That's right--perl math always ends up as floats. No longer true as of 5.7.3 when IVs/UVs are larger than the floating point mantissa and the result is exact: $ /usr/local/perl5.8.1-snap21133/bin/perl5.8.1 -MDevel::Peek -le '$a=0xFFFFFFFFFFFFFFFF/3; Dump $a' SV = IV(0x8145674) at 0x8144cb8 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 6148914691236517205 The same perl for a small value uses NVs: $ /usr/local/perl5.8.1-snap21133/bin/perl5.8.1 -MDevel::Peek -le '$a=0xFF/3; Dump $a' SV = NV(0x814b4cc) at 0x8144c90 REFCNT = 1 FLAGS = (NOK,pNOK) NV = 85 Nicholas Clark