Dan Sugalski <[EMAIL PROTECTED]> 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.

I'm not sure:

$ perl -MDevel::Peek -e 'Dump 4.2/2.'
SV = PVNV(0x8149f78) at 0x8124b78
  REFCNT = 1
  FLAGS = (NOK,READONLY,pIOK,pNOK)
  IV = 2
  NV = 2.1
  PV = 0

$ perl -MDevel::Peek -e 'Dump 4.2/2.1'
SV = PVNV(0x8149f80) at 0x8124b78
  REFCNT = 1
  FLAGS = (IOK,NOK,READONLY,pIOK,pNOK)
  IV = 2
  NV = 2
  PV = 0

AFAIK is (IOK, pIOK) the same as a real IV.

At least they look differently:

$ perl -le 'print 4.2/2.1'
2

$ echo 'div N0, 4.2, 2.1
print N0
print "\n"' | parrot -a -
2.000000

>                                       Dan

leo

Reply via email to