How do you explain the modulo operation? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do you explain the modulo operation?

1.25 % 0.5 = 0.25

27th Jun 2019, 5:05 PM
Abdel
Abdel - avatar
2 Answers
+ 2
It divides the 2 numbers, and returns the remainder. You know, like in second grade: 7 / 3 = 2, remainder is 1, because 7 - (3 * 2) = 1 1.25 / 0.5 is 2, remainder is 0.25
27th Jun 2019, 5:11 PM
Airree
Airree - avatar
+ 2
Modulo operation gives the reminder of division. In this case => 2*0.5 = 1.0 and the reminder is 1.25 - 1.0 => 0.25.
27th Jun 2019, 5:13 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar