Quick question


#1

How does modulo work? It says 3 is the remainder after dividing 15 by 6. But 15 divided by 6 is 2,5. How does remainder work, can anyone explain?


#2
17 / 5 = 3, 2 remainder

17 % 5 = 2

Also,

15 / 6 = 2, 3 remainder

Now let’s examine this a little further…

15 / 6 = 2 + 0.5

6 * 0.5 = 3

See the connection?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.