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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Modulo operation to return quotient and remainder
by Borodin (Sexton) on Jun 07, 2017 at 21:49 UTC |
In Section
Seekers of Perl Wisdom