Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Modulo operation to return quotient and remainder

by moritz (Cardinal)
on Jul 12, 2012 at 11:54 UTC ( #981384=note: print w/replies, xml ) Need Help??


in reply to Modulo operation to return quotient and remainder

While many modern CPU instruction sets support getting quotient and remainder in a single operation, nearly no high-level programming languages support it. Not even C (unless via embedded assembler).

In Perl, the overhead of a single subroutine call is probably much bigger than simply performing two separate operations, so from a performance point of view, you shouldn't bother.

If you are after convenience, it's easy enough to write a subroutine yourself that does it.

  • Comment on Re: Modulo operation to return quotient and remainder

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981384]
help
Chatterbox?
[hippo]: Is the NVIDIA driver problem still a thing?
[zentara]: See problems with Nvidia and Linus Torvalds
[choroba]: that's 2012
[zentara]: I just acquired a computer with the card type, and wondered if it was best to stick with the open-source code or use NVIDIA's proprietary code

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-05-26 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?