Top "Modulo" questions

The modulo (sometimes called modulus) operation finds the remainder of division of one number by another.

Why does C++ output negative numbers when using modulo?

Math: If you have an equation like this: x = 3 mod 7 x could be ... -4, 3, 10, 17, ..., or more generally: x = 3 + k * 7 where …

c++ standards modulo
re implement modulo using bit shifts?

I'm writing some code for a very limited system where the mod operator is very slow. In my code a …

c++ optimization bit-manipulation modulo bit-shift
Check if a number is divisible by 3

I need to find whether a number is divisible by 3 without using %, / or *. The hint given was to use atoi() …

division modulo integer-division
Divide and Get Remainder at the same time?

Apparently, x86 (and probably a lot of other instruction sets) put both the quotient and the remainder of a divide …

x86 modulo divide
Mathematical modulus in c#

Is there a library function in c# for the mathematical modulus of a number - by this I specifically mean …

c# modulo
nth-child with mod (or modulo) operator

Is it possible to use the nth-child with modulo? I know you can specify a formula, such as nth-child(4n+2) …

css css-selectors modulo
How do you calculate div and mod of floating point numbers?

In Perl, the % operator seems to assume integers. For instance: sub foo { my $n1 = shift; my $n2 = shift; print "perl's …

perl math floating-point division modulo
How can I get the quotient and the remainder in a single step?

Possible Duplicate: Divide and Get Remainder at the same time? Is it possible to get both the quotient and the …

c++ c modulo integer-division
Is there a modulus (not remainder) function / operation?

In Rust (like most programming languages), the % operator performs the remainder operation, not the modulus operation. These operations have different …

rust modulo
How can I modulo when my numbers start from 1, not zero?

I guess the solution for this is quite simple, but I've been thinking about it for a while and couldn't …

modulo