## Modulus Division Introduction

Have you ever heard or seen modular division before? Modulus division often involves the % symbol as the operator just like + for addition, - for subtractions, * for multiplication, and / for division. It is a lot easier than long division because normally it is used in simple applications like figuring out if a number is even or odd. If I asked a programmer how to determine if an integer (-9,-8...0,1,2...9,10) was even he would answer "number percent sign 2 is equal to 0" or sometimes "use modular division". Modulus Division + Common Operation Calculator

**Definition of "Modulus Division"**
Many of the definitions on the internet for Modulus Division seem hellishly unreasonable, so let me put it in simple terms.

In simple terms,

2 % 6 = 2

6 is bigger than 2 to start with so the remaining integer of the dividend is 2.

6 % 3 = 0

6 / 3 = 2 with a remainder of 0.

5 % 2 = 1

5/2 is 2.5 which is not an integer, so, you need to find the highest number that does fit into 5 that is a multiple of 2 (hint: it rhymes with s'more). Four and... 5 - 4 = 1.

16 % 16 = 0

16 goes into 16 one time only and has a remainder of 0.

1000 % 3 = 1

999 is a multiple of 3 that is less than the dividend, 1000. Thus, 1000 - 999 = 1.

In simple terms,

**modulus division**is the process of dividing one number by another (division) only to find the remainder that is left over. The number of times the number goes into the other is thrown away (hypothetically). All modulus division does is return the remainder.*Common Mathematical Examples*2 % 6 = 2

6 is bigger than 2 to start with so the remaining integer of the dividend is 2.

6 % 3 = 0

6 / 3 = 2 with a remainder of 0.

5 % 2 = 1

5/2 is 2.5 which is not an integer, so, you need to find the highest number that does fit into 5 that is a multiple of 2 (hint: it rhymes with s'more). Four and... 5 - 4 = 1.

16 % 16 = 0

16 goes into 16 one time only and has a remainder of 0.

1000 % 3 = 1

999 is a multiple of 3 that is less than the dividend, 1000. Thus, 1000 - 999 = 1.

**How to do Modulus Division**An example of long division. 16 % 15 = 1 |

*Importance Of Modulus Division*
In computer programming it can be used to distinguish whether an array or list of variables is of an appropriate size for a system. An example of that is if a system could only interpret bytes as arrays of 8 bits, the system could use modulus division to be sure no sets of the array would be broken into a piece of less than 8 pieces. {A byte is a unit of data storage used in digital systems and computers with 8 individual bits (binary digits)}.

Another example in computer science is to determine whether a number is even, odd, or even prime. The prime number algorithm takes a bit more thought than the even and odd number algorithm, so I will just show an example of an even number algorithm in the following section titled "Example Code Snippets."

Another example in computer science is to determine whether a number is even, odd, or even prime. The prime number algorithm takes a bit more thought than the even and odd number algorithm, so I will just show an example of an even number algorithm in the following section titled "Example Code Snippets."

**Example Code Snippets**

*[in Java]*//Even number methodpublic void getEven(int num){if(num%2==0){return true;} else {return false;}

## More Resources

- Modular Arithmetic On Wikipedia
- Modulo Operation On Wikipedia
- C Programming Modulus Operator
- http://mathdude.quickanddirtytips.com/how-to-do-multiplication-and-division-in-modular-arithmetic.aspx
- http://www.mathworks.com/help/techdoc/ref/mod.html
- Youtube Video Of Integer Division and Modulus Division

## No comments:

Post a Comment