I've been going over the math a million times, but I just don't get the logic behind the modulo symbol. It says 17 % 5 means its dividing 17 by 5, but that does in no way result in 2. Can anyone please explain this apparently easy math to me?

# Modulo logic?

**mtf**#2

A million times? In less than the time needed to read this phrase I already had it searched. Did this generation never do any whole number division? Are remainders that foreign?

**ragezapper**#3

17 % 5 is not typically 17 **divided** by 5, but it actually means of what the remainder is when you divide the number. For example, 19 % 2 would equal 1. Why? It's because 19 divided by 2 gives a remainder of 1. Same with 17 % 5. If you divide 17 with 5, you get 3 remainder 2! That's why the answer is 2. % gives the remainder, not the actual answer.

Hope it helped!

**ameliap1**#8

I don't get this;

// console.log (14%3)

is reading; did you console log() the result of 14%

if you hav 17 % 5 you need to ask how many times can you put 5 into 17

the answer is 3 times but you still have 2 left that 2 is the answer

another example is

22 % 10

how many times can you put 10 into 22

answer 2 times than you got 20 but your left with 2

so 2 is the answer

if it isn't clear plz tell me