Wanted to find out what happens the numerator is smaller than the denominator for instance 4%8? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Wanted to find out what happens the numerator is smaller than the denominator for instance 4%8?

Modulus operator

22nd Jan 2019, 11:11 PM
TUMAINI BENJAMIN EMMANUEL
TUMAINI BENJAMIN EMMANUEL - avatar
4 Respostas
+ 4
You can use the code playground. The result will always the same as the numerator. 4%8 = 4 1%7 = 1 https://stackoverflow.com/questions/3622298/how-does-modulus-of-a-smaller-dividend-and-larger-divisor-work
22nd Jan 2019, 11:34 PM
Denise RoƟberg
Denise RoƟberg - avatar
+ 3
I like to think of it like this: Q: What is the remainder of a smaller number divided by the larger number? A: It goes in zero times, with the smaller number left over. In other words, the smaller number will always be the remainder in a modulo division, like Denise RoƟberg said.
23rd Jan 2019, 1:25 AM
Zeke Williams
Zeke Williams - avatar
+ 1
Awesome thanks for the explanation guys!!
23rd Jan 2019, 4:27 AM
TUMAINI BENJAMIN EMMANUEL
TUMAINI BENJAMIN EMMANUEL - avatar
+ 1
Ł…Ł† Ł†Ł…ŪŒŲÆŁˆŁ†Ł… šŸ˜•
23rd Jan 2019, 9:38 PM
Ruby
Ruby - avatar