Calculator
3 modulo 5 =
3
🌐
CalculatorSoup
calculatorsoup.com › calculators › math › modulo-calculator.php
Modulo Calculator
If you did not use the mod operator you would have to do the math in your code. For example you would have to calculate "is 496 a multiple of 4?". You would divide 496 by 4, so 496 / 4 = 124 with no remainder.
🌐
Quora
quora.com › What-is-3mod5
What is 3mod5? - Quora
Answer (1 of 3): In software, “mod” tends to be used as a binary operation, where “m \mod n" is the remainder when m is divided by n. (There are different rules for what to do when either m or n is negative, depending on which environment one is in. At my job we use both C++ and Python, ...
Discussions

Why is -5 mod 3 = 1 and not 2?
Because -5+2(3)=1. But 2=-5+7, and 7 isn't a multiple of 3. In general, negatives and positives need not be congruent in modular arithmetic. 5 and -5 are 10 apart, so -5 ≢ 5 mod 3. More on reddit.com
🌐 r/learnmath
13
9
December 7, 2016
what is mod?
n (mod m) is just the remainder you get when divide n by m. So for example, take 27 (mod 5). When you divide 27 by 5, you have 2 remaining ( because 27 = 5 * 5 + 2). That's really all it is, it gives you the integer remainder of a number divided by m. If you write out some examples you'll see why it cycles: 0 = 0 * 5 + 0 [0 mod 5 = 0] 1 = 0 * 5 + 1 [1 mod 5 = 1] 2 = 0 * 5 + 2 [2 mod 5 = 2] 3 = 0 * 5 + 3 [3 mod 5 = 3] 4 = 0 * 5 + 4 [4 mod 5 = 4] 5 = 1 * 5 + 0 [5 mod 5 = 0] 6 = 1 * 5 + 1 [6 mod 5 = 1] 7 = 1 * 5 + 2 [7 mod 5 = 2] 8 = 1 * 5 + 3 [8 mod 5 = 3] 9 = 1 * 5 + 4 [9 mod 5 = 4] ... You may also hear than a = b (mod n) if (b - a) is a multiple of n. But this is just because if a and b are equal (mod n) then they have to have the same remainder r, so a = nx + r and b = ny + r, but then b - a = n(y - x) as stated above. More on reddit.com
🌐 r/learnmath
8
1
April 27, 2023
elementary number theory - Mod question: $-5 \pmod 3$? - Mathematics Stack Exchange
Alternatively, simply note that $$-5 = 1 + 3 \cdot -2 \implies -5 = 1\pmod{3}.$$ ... The other answers already give you enough ways to get to $5\equiv -1\equiv 2 ~(\operatorname{mod}3) $, I just want to say something about your notation. More on math.stackexchange.com
🌐 math.stackexchange.com
July 16, 2015
Understanding The Modulus Operator % - Stack Overflow
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 ... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

How much is 17 mod 3?

17 mod 3 equals 2 since dividing 17 by 3 gives a quotient of 5 and a remainder of 2. The remainder is the result of the modulus operation. In simpler terms, 17 mod 3 = 2.

🌐
omnicalculator.com
omnicalculator.com › math › modulo
Modulo Calculator
How to calculate modulo division?

To calculate modulo division: subtract the divisor from the dividend until the resultant is less than the divisor.

🌐
omnicalculator.com
omnicalculator.com › math › modulo
Modulo Calculator
What are the components of modulo division?

The components of modulo division are dividend, divisor, quotient, and remainder. The remainder is the answer or end result of the operation.

🌐
omnicalculator.com
omnicalculator.com › math › modulo
Modulo Calculator
🌐
Divisible Info
divisible.info › Modulo › What-is-3-mod-5.html
What is 3 mod 5? (3 modulo 5?)
Here is the math to illustrate how to get 3 mod 5 using our Modulo Method: 3 ÷ 5 = 0.6 0 × 5 = 0 3 - 0 = 3 Thus, the answer to "What is 3 mod 5?" is 3. Modulus Method To find 3 mod 5 using the Modulus Method, we first find the highest multiple of the Divisor (5) that is equal to or less than ...
🌐
Omni Calculator
omnicalculator.com › math › modulo
Modulo Calculator
May 8, 2025 - The components of modulo division are dividend, divisor, quotient, and remainder. The remainder is the answer or end result of the operation. 17 mod 3 equals 2 since dividing 17 by 3 gives a quotient of 5 and a remainder of 2.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › utilities › modulo-calculator
Modulo Calculator - Find Modulo of Two Numbers - GeeksforGeeks
3 days ago - The modulo operation finds the remainder of a divided by b. To do this by hand just divide two numbers and note the remainder. If you need to find 13 mod 5, divide 13 by 5. ... Divide a by b to find the remainder. 13 ÷ 5 = 2 R3, 2 is the dividend ...
🌐
Wikipedia
en.wikipedia.org › wiki › Modular_arithmetic
Modular arithmetic - Wikipedia
5 days ago - Because the congruence modulo m is defined by the divisibility by m and because −1 is a unit in the ring of integers, a number is divisible by −m exactly if it is divisible by m. This means that every non-zero integer m may be taken as a modulus. ... because the difference is 38 − 14 = 24 = 2 × 12, a multiple of 12. Equivalently, 38 and 14 have the same remainder 2 when divided by 12. The definition of congruence also applies to negative values. For example: ... {\displaystyle {\begin{aligned}2&\equiv -3{\pmod {5}}\\-8&\equiv {\phantom {+}}7{\pmod {5}}\\-3&\equiv -8{\pmod {5}}.\end{aligned}}}
🌐
Wikipedia
en.wikipedia.org › wiki › Modulo
Modulo - Wikipedia
2 weeks ago - For example, the expression "5 mod 2" evaluates to 1, because 5 divided by 2 has a quotient of 2 and a remainder of 1, while "9 mod 3" would evaluate to 0, because 9 divided by 3 has a quotient of 3 and a remainder of 0.
🌐
Math Celebrity
mathcelebrity.com › home › subjects › calculators . › modulus calculator
Modulus Calculator
Modulus Calculator: Free Modulus Calculator - Given 2 integers a and b, this modulo calculator determines a mod b or simplifies modular arithmetic such as 7 mod 3 + 5 mod 8 - 32 mod 5
🌐
Reddit
reddit.com › r/learnmath › why is -5 mod 3 = 1 and not 2?
Why is -5 mod 3 = 1 and not 2? : r/learnmath
December 7, 2016 - Exactly the same way as you do ... add back your negative sign. For example, -179 mod 10 is -9 mod 10 which is 1 mod 10. In your case, -5 mod 3 is -2 mod 3 which is 1 mod 3....
🌐
Wolfram|Alpha
wolframalpha.com › input
-5 mod 3 - Wolfram|Alpha
Compute answers using Wolfram's breakthrough technology & knowledgebase, relied on by millions of students & professionals. For math, science, nutrition, history, geography, engineering, mathematics, linguistics, sports, finance, music…
🌐
YouTube
youtube.com › peter sherwin
Linear congruences - modular arithmetic (3 of 5) - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new features · © 2024 Google LLC
Published   July 5, 2017
Views   216
🌐
BetterExplained
betterexplained.com › articles › fun-with-modular-arithmetic
Fun With Modular Arithmetic – BetterExplained
For example, “5 mod 3 = 2” which means 2 is the remainder when you divide 5 by 3.
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.

🌐
Quora
quora.com › If-x-equivalent-5-mod-3-What-is-x
If x equivalent 5 mod 3? What is x? - Quora
Answer (1 of 3): This question is easy to answer, but only if you understand what “5 mod 3” means. The “mod” or modulus function can be another way of asking what the remainder would be from a long division problem. So, if you take the number five and divide it by three, you get one ...
🌐
Calculators.org
calculators.org › math › modulo.php
Modulo Calculator
a mod n (abbreviated version) 17 - 3 = 14 · 14 - 3 = 11 · 11 - 3 = 8 · 8 - 3 = 5 · 5 - 3 = 2 · 20 - 5 = 15 · 15 - 5 = 10 · 10 - 5 = 5 · 5 - 5 = 0 · - Guide Authored by Corin B. Arenas, published on October 24, 2019 · Most people haven’t heard of modular arithmetic or mod outside ...
🌐
Reddit
reddit.com › r/askmath › do you have any insights on how to approach this question?
r/askmath on Reddit: Do you have any insights on how to approach this question?
August 28, 2023 - Notice that, at any step in multiplying by 3, you can throw away as many 5s as you like from the original number and it won't affect the remainder when you ultimately divide by 5. Take 7 for example, if you multiply it by 3 then you get 21, ...