views:

246

answers:

6

I don't really understand how modulus division works. I was calculating 27 % 16 and wound up with 11 and I don't understand why.

I can't seem to find an explanation in layman's terms online. Can someone elaborate on a very high level as to what's going on here?

EDIT: Thanks for all your answers. You guys are incredibly quick. It all makes sense now.

+9  A: 

The result of a modulo division is the remainder of an integer division of the given numbers.

That means:

27 / 16 = 1, remainder 11
=> 27 mod 16 = 11

Other examples:

30 / 3 = 10, remainder 0
=> 30 mod 3 = 0

35 / 3 = 11, remainder 2
=> 35 mod 3 = 2
Mef
Answered first by a small margin have to mark yours as the answer... Thanks. EDIT: Got to wait ~9 minutes.
NSWOA
A: 

11 is the remainder of 27/16

Doug Currie
+1  A: 

modulus division is simply this : divide two numbers and return the remainder only

27 / 16 = 1 with 11 left over, therefore 27 % 16 = 11

ditto 43 / 16 = 2 with 11 left over so 43 % 16 = 11 too

oedo
A: 

Very simple: a % b is defined as the remainder of the division of a by b.

See the wikipedia article for more examples.

Yuval A
A: 

Modulus division gives you the remainder of a division, rather than the quotient.

samoz
+2  A: 

Maybe the example with an clock could help you understand the modulo.

A familiar use of modular arithmetic is its use in the 12-hour clock, in which the day is divided into two 12 hour periods.

Lets say we have currently this time: 15:00
But you could also say it is 3 pm

This is exactly what modulo does:

15 / 12 = 1, remainder 3

You find this example better explained on wikipedia: Wikipedia Modulo Article

Prine