The Remainder Operator

It might be Mathematical, but you need this in order to be an effective programmer be it Java, Python or Swift. Trust me…

Steven Curtis
4 min readNov 26, 2019

It is common for tutorials to assume that you know the remainder operator. But what is it, and why do we need it?

Photo by JOHN TOWNER on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

Terminology

Dividend: The amount you want to divide up

Divisor: Is another number by which another number is divided

Integer: A number that has no fractional part, that is no digits after the decimal point

Remainder: The remainder that is left over when a number is divided by another

Modulus: Another term for remainder

Division (Integer): A division in which the fractional part (remainder) is discarded

Integer division

Integer division involves whole numbers. This means that we are only interested in whole numbers.

Let us think this through.

We are dividing a whole number by a whole number, and are only interested in a whole number as a result.

--

--