Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: A better mod (%) operator?

by BrowserUk (Pope)
on Jul 09, 2002 at 00:11 UTC ( #180356=note: print w/replies, xml ) Need Help??


in reply to Re: A better mod (%) operator?
in thread A better mod (%) operator?

It wasn't really a "search for speed" that drove the thought, it was more elegance, orthogonality and that it bugs me that I know that the 'other part of the equation' is sitting there in a register somewhere but I have to do the division again to get it.

Down the years, It seems that almost every time I have made use of the mod operator, I have also done a div with the same parameters.

Finally using Perl, I have a language that could elegantly provide me with both halves of the equation in one pass and render the elegance that comes with it.

I hadn't thought about the expense of constructing the return list. Is it possible to "re-use" the inbound @_ list? Would there be any benefit in doing so?

I wonder how constructing a new list would compare (at the inner levels) with duplicating the whole inbound/outbound stack frames etc.? Possibly little in it?

Basically, I don't yet know enough to judge and am not ready to go digging deep enough to get the answers.

T'was just an idea:^).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2020-11-25 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?