Top "Modulus" questions

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

What is the modulus operator (%) in swift 3?

I have this line: randomIndex = Int(drand48() % Double(alphabetColors.count)) And Xcode 8 (Swift 3) tells me: '%' is unavailable: Use …

swift3 modulus
`java (0 % 2 != 0) == false`

The part I keep getting stuck on is boolean(0 % 2 !=0) == false. I mean if 2 goes into 0, 0 times then the remainder would …

java boolean zero modulus
Find multiples of a number in PHP

I want to find all muliples of a number in PHP. I'm using something like this if($count != 20 ) to work …

php division modulus
How to select odd or even items from a row in SQL?

I need only even or odd items, so I find modulus operation and this doesn't works SELECT * FROM table ORDER …

sql modulus operation
Using mod operator in iOS app

I have an NSTimeInterval that is stored as a double. I would like to get the amount of minutes that …

iphone nstimeinterval modulus
Why does modulus operator return fractional number in javascript?

Why does 49.90 % 0.10 in JavaScript return 0.09999999999999581? I expected it to be 0.

javascript floating-point modulus
Fast way to calculate n! mod m where m is prime?

I was curious if there was a good way to do this. My current code is something like: def factorialMod(…

algorithm math factorial modulus
What is the modulo operator for longs in Java?

How do I find the modulo (%) of two long values in Java? My code says 'Integer number too large' followed …

java long-integer modulo modulus
Faster modulus in C/C#?

Is there a trick for creating a faster integer modulus than the standard % operator for particular bases? For my program, …

c# math optimization modulus
Modular Exponentiation in Java

I need a way to calculate: (g^u * y^v) mod p in Java. I've found this algorithm for calculating (…

java math modulus dsa exponentiation