Help me understand modulus operators
August 8, 2006 6:17 AM
Subscribe
My maths skills are rubbish. Help me understand modulus remainders
I'm working my way through some JavaScript stuff and have seen the modulus operator used quite a bit. All well and good, but it doesn't make sense. It's supposed to return the remainder after a division, so I can see why 9%3 (9÷3) is 0. But, if 12%100 is 12 (12÷100 = 0.12), why is 1%2 1 and not 5 (1÷2 = 0.5) and why does 8%3 = 2 and not 66 (8÷3 = 2.66)?
posted by TheDonF to education (10 comments total)
3 goes into 9 three times (3x3=9) with 0 left over (remainder).
Wikipedia page
posted by handee at 6:22 AM on August 8, 2006