How to use the modulus operator at a number smaller than the other? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to use the modulus operator at a number smaller than the other?

If I want to use the modulus operator on 2 numbers, the first being smaller than the second, what do I get? Ex: 1 % 30

21st Apr 2021, 5:03 PM
Rzv19
2 Answers
+ 2
You always get the smaller number as result, so there's actually no point in doing the modulus operation.
21st Apr 2021, 5:13 PM
XXX
XXX - avatar
0
Thanks
21st Apr 2021, 5:14 PM
Rzv19