Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Numeric overloading with 64-bit Perl

by tonyc (Pilgrim)
on Oct 07, 2005 at 00:51 UTC ( #498095=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Numeric overloading with 64-bit Perl
in thread Numeric overloading with 64-bit Perl

You're right. Sorry for the assumption.

I think I see the cause of the problem. If you look at pp_add (pp_hot.c) you'll see that it checks for the IV and UV flags on the scalar (SvIOK, SvUOK) and since neither of these is set it falls through to do the arithmetic with NVs.

To fix this the magic code would need to be hoisted out of sv_2iv_flags() and the check for SvIOK (or SvUOK) done on the scalar returned by the numeric overload.

Fixing this for every operator would be a big change.

Edit: pp_add is in pp_hot.c, not sv.c


Comment on Re^3: Numeric overloading with 64-bit Perl
Re^4: Numeric overloading with 64-bit Perl
by jdhedden (Deacon) on Oct 07, 2005 at 12:42 UTC
    I put in a bug report for this. Thanks for the confirmation.

    Remember: There's always one more bug.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://498095]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-09-20 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls