Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Adding 2 + 2

by ikegami (Pope)
on Jul 22, 2005 at 15:47 UTC ( #477263=note: print w/ replies, xml ) Need Help??


in reply to Adding 2 + 2

$lterm = 2; # lterm = 2 $rterm = 2; # rterm = 2 $#add = $lterm; pop(@add); # add = lterm push(@acc, @add); # acc += add $#add = $rterm; pop(@add); # add = rterm push(@acc, @add); # acc += add push(@acc, 1); $sum = $#acc; # sum = acc print("$sum\n");

It must be fast, since the addition is done by push, which is written in C! ;)


Comment on Re: Adding 2 + 2
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-11-27 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (180 votes), past polls