computational operation
In computing and mathematics, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another, the latter being called the modulus of the operation. … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Modulo
Modulo - Wikipedia
2 days ago - In mathematics, the result of the modulo operation is an equivalence class, and any member of the class may be chosen as representative; however, the usual representative is the least positive residue, the smallest non-negative integer that belongs to that class (i.e., the remainder of the ...
Top answer
1 of 9
35

The pattern

X modulo Y

is an informal but common parlance in technical, especially mathematically, oriented talk. It is used to mean informally 'X, ignoring Y'. For example,

"The rocket design was flawless, modulo the toxic waste produced by its fuel."

The meaning is inspired by, but not perfectly corresponding to, the arithmetic modulo function (for example, clock-time addition) which when suitably abstracted involves 'collapsing' all items of a set into the special items of the set, so that the full set does not need to be dealt with (this is where the associated meaning of 'ignoring' comes from).

In your interpretation "note what parts of it still need to be modified", the 'modified' part is irrelevant. 'Modulo' is pragmatically "I'm telling you about the most important part (the X), but remarking on the existence of some part that might be important for other reasons but under the current context we want to ignore (the Y)".

2 of 9
8

I only see this usage from academics with a background that includes England. It is used to mean the opposite of except - some part of the set is included, not excluded, and you're saying that you're including it even though some people might not. It isn't a substitute for but or except, because those would be about excluding something from the set. It might be closer to even though.

In math, modulo is the remainder after dividing, so 5 mod 2 is 1. In words, it's something like even after accounting for. However, it has been heard by generations of people who aren't sure what it means, don't want to ask, and feel that smart people use it. Those people tend to use it as except or but, meaning that you probably can't be entirely sure any more what someone means when they use it.

🌐
BetterExplained
betterexplained.com › articles › fun-with-modular-arithmetic
Fun With Modular Arithmetic – BetterExplained
The modulo operation (abbreviated “mod”, or “%” in many programming languages) is the remainder when dividing.
🌐
Wikipedia
en.wikipedia.org › wiki › Modulo_(mathematics)
Modulo (mathematics) - Wikipedia
July 13, 2025 - In mathematics, the term modulo ("with respect to a modulus of", the Latin ablative of modulus which itself means "a small measure") is often used to assert that two distinct mathematical objects can be regarded as equivalent—if their difference is accounted for by an additional factor.
🌐
Merriam-Webster
merriam-webster.com › dictionary › modulo
MODULO Definition & Meaning - Merriam-Webster
The meaning of MODULO is with respect to a modulus of. How to use modulo in a sentence.
🌐
Language Hat
languagehat.com › modulo
MODULO. : languagehat.com
An overgeneralization of mathematical terminology; one can consider saying that 4 equals 22 except for the 9s (4 = 22 mod 9). ‘Well, LISP seems to work okay now, modulo that GC bug.’ ‘I feel fine today modulo a slight headache.'” ... Definition b) is probably just sloppily written, and meant to say “taking into account X and discarding it”. None of the examples show the contradictory sense. ... The usage in the Journal of Philosophy article doesn’t look much like sense (a) to me; it might or might not be sense (b) or something even closer to meaninglessness.
🌐
Math is Fun
mathsisfun.com › definitions › modulo-operation.html
Modulo Operation Definition (Illustrated Mathematics Dictionary)
The modulo (or "modulus" or "mod") is the remainder after dividing one number by another.
Find elsewhere
Top answer
1 of 9
226

(This explanation is only for positive numbers since it depends on the language otherwise)

Definition

The modulo operation returns the remainder or signed remainder of a division, after one number is divided by another, the latter being called the modulus of the operation. (source: wikipedia)

For instance, 9 divided by 4 equals 2 but it remains 1. Here, 9 / 4 = 2 and 9 % 4 = 1.

Image source: Wikimedia

In your example: 5 divided by 7 gives 0 but it remains 5 (5 % 7 == 5).

Calculation

The modulo operation can be calculated using this equation:

a % b = a - floor(a / b) * b
  • floor(a / b) represents the number of times you can divide a by b
  • floor(a / b) * b is the amount that was successfully shared entirely
  • The total (a) minus what was shared equals the remainder of the division

Applied to the last example, this gives:

5 % 7 = 5 - floor(5 / 7) * 7 = 5

Modular Arithmetic

That said, your intuition was that it could be -2 and not 5. Actually, in modular arithmetic, -2 = 5 (mod 7) because it exists k in Z such that 7k - 2 = 5.

You may not have learned modular arithmetic, but you have probably used angles and know that -90° is the same as 270° because it is modulo 360. It's similar, it wraps! So take a circle, and say that its perimeter is 7. Then you read where is 5. And if you try with 10, it should be at 3 because 10 % 7 is 3.

2 of 9
37

Two Steps Solution.

Some of the answers here are complicated for me to understand. I will try to add one more answer in an attempt to simplify the way how to look at this.


Short Answer:

Example 1:

7 % 5 = 2

Each person should get one pizza slice.

Divide 7 slices on 5 people and every one of the 5 people will get one pizza slice and we will end up with 2 slices (remaining). 7 % 5 equals 2 is because 7 is larger than 5.


Example 2:

5 % 7 = 5

Each person should get one pizza slice

It gives 5 because 5 is less than 7. So by definition, you cannot divide whole 5items on 7 people. So the division doesn't take place at all and you end up with the same amount you started with which is 5.


Programmatic Answer:

The process is basically to ask two questions:

Example A: (7 % 5)

(Q.1) What number to multiply 5 in order to get 7?

Two Conditions: Multiplier starts from `0`. Output result should not exceed `7`. 

Let's try:

Multiplier is zero 0 so, 0 x 5 = 0

Still, we are short so we add one (+1) to multiplier.

1 so, 1 x 5 = 5

We did not get 7 yet, so we add one (+1).

2 so, 2 x 5 = 10

Now we exceeded 7. So 2 is not the correct multiplier. Let's go back one step (where we used 1) and hold in mind the result which is5. Number 5 is the key here.

(Q.2) How much do we need to add to the 5 (the number we just got from step 1) to get 7?

We deduct the two numbers: 7-5 = 2.

So the answer for: 7 % 5 is 2;


Example B: (5 % 7)

1- What number we use to multiply 7 in order to get 5?

Two Conditions: Multiplier starts from `0`. Output result and should not exceed `5`. 

Let's try:

0 so, 0 x 7 = 0

We did not get 5 yet, let's try a higher number.

1 so, 1 x 7 = 7

Oh no, we exceeded 5, let's get back to the previous step where we used 0 and got the result 0.

2- How much we need to add to 0 (the number we just got from step 1) in order to reach the value of the number on the left 5?

It's clear that the number is 5. 5-0 = 5

   5 % 7 = 5

Hope that helps.

🌐
Collins Dictionary
collinsdictionary.com › dictionary › english › modulo
MODULO definition and meaning | Collins English Dictionary
Mathematics having a reference to modulus or a number that divides into others numbers and.... Click for English pronunciations, examples sentences, video.
🌐
Omni Calculator
omnicalculator.com › math › modulo
Modulo Calculator
May 8, 2025 - Let's say it is late at night — 11 pm 🕚. You wonder what time it will be when you wake up after 8 hours of sleep. You can't just add 8 to 11, as there is no such time as 19 am. To find the correct answer, perform a modulo operation (mod 12) — add these two numbers and keep subtracting 12 until you get a number lower than 12.
🌐
Wiktionary
en.wiktionary.org › wiki › modulo
modulo - Wiktionary, the free dictionary
From Latin modulō, ablative of modulus (“a measure”).
🌐
TheFreeDictionary.com
thefreedictionary.com › modulo
Modulo - definition of modulo by The Free Dictionary
1. Mathematics With respect to a specified modulus: 18 is congruent to 42 modulo 12 because both 18 and 42 leave 6 as a remainder when divided by 12. 2. Correcting or adjusting for something, as by leaving something out of account: This proposal ...
🌐
Wikipedia
en.wikipedia.org › wiki › Modular_arithmetic
Modular arithmetic - Wikipedia
1 week ago - This notation is not to be confused with the notation b mod m (without parentheses), which refers to the remainder of b when divided by m, known as the modulo operation: that is, b mod m denotes the unique integer r such that 0 ≤ r < m and r ≡ b (mod m).
🌐
Reddit
reddit.com › r/learnjava › what the hell is a modulo?
r/learnjava on Reddit: What the HELL is a modulo?
July 18, 2016 -

I have a test tomorrow, in the test one of the questions will be to seperate a number from a 3 digit number, say I have 641, I need to know how to print out 6,4 and 1 seperately.

What the hell do I do ? The teacher is so bad I couldn't understand a word she said and neither did my class, we already complained about her but this isn't the issue, the issue is that I have no easy answers on the internet for what the modulo is.

Why does doing (n/100)%10; print out the hundred digit ? I have no idea how this works, please go easy on me.

Top answer
1 of 5
3
The modulo operator returns the "remainder" of a division. If you think back to your early days at school, when you first learned dividing using long divisions , you learned that for 14/4 the result is 3 and the remainder is 2. Because "4" fits "3" times in '14", but then you still have a remainder of "2" so that: 14 = 4 x 3 + 2 Now, why do they suggest using the modulo operator to get the different numbers (6, 4, 1). Well, let's start from the right. If we divide 641/10, we know that it fits 64 times inside 641 and the remainder is 1. In java terms this is: int lastDigit = 641 % 10; // 1 Now, you can repeat the same process over and over again, however, we need to "shift" the number a bit. For example, if we want to know the second digit, we first divide 641 by 10, so that we only have 64. Now we can just retrieve the last digit again by using the modulo operator: int secondDigit = 641 / 10 % 10; // = 64 % 10 = 4 Now, you should start to see a system here. You can keep doing this trick over and over again, but in stead of dividing by 10, you divide by 100, 1000, 10000, 100000, ... and you get the next digit every time. In your case, the left digit can be retrieved by using: int firstDigit = 641 / 100 % 10; // = 6 % 10 = 6 In this case, it's pretty "useless" to use the modulo operator, because if you have a number with only 3 digits, dividing by 100 will already yield the left most digit. However, let's say that our number was 1234, then we would get: int digit = 1234 / 100 % 10; // = 12 % 10 = 2
2 of 5
1
Modulo is the remainder from integer division. 4 / 3 = 1 r 1 4 % 3 = 1
🌐
Federico Hatoum
hatoum.com › blog › 2012 › 12 › practical-uses-for-modulo-operator.html
Practical uses for the modulo operator — Federico Hatoum
August 28, 2013 - I shared my dilemma with Felix, a more experienced and knowledgeable programmer at work who taught me about the modulus operator. The modulus operator returns the remainder of a division of one number by another. In most programming languages, modulo is indicated with a percent sign.
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › modulo-operator-in-c-cpp-with-examples
Modulo Operator (%) in C/C++ with Examples - GeeksforGeeks
July 12, 2025 - In C or C++, the modulo operator (also known as the modulus operator), denoted by %, is an arithmetic operator.
🌐
Computer Hope
computerhope.com › jargon › m › modulo.htm
What Is Modulo?
Modulo is a math operation that finds the remainder when one integer is divided by another.