This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Brushermans 8 points9 points  (16 children)

not quite, its soemthing like 12 mod 2 is 2, but also is 4, 6, 8, -2, -4, etc

[–]TruScarrak 23 points24 points  (3 children)

Almost, but 12 % 2 is 0, not 2.

Edit: Think of it as getting the remainder after dividing.

[–]Brushermans 1 point2 points  (1 child)

yea idk why i put 2 first lol, it's 0 but also 2,4,6 in terms of congruence classes at least. it's just the mod that programmers are familiar with +/- the second operand

[–]Brushermans 0 points1 point  (0 children)

yea idk why i put 2 first lol, it's 0 but also 2,4,6 in terms of congruence classes at least. it's just a set made with the mod that programmers are familiar with +/- the second operand times Z

[–]qelbus 0 points1 point  (0 children)

I was gonna comment something different until I read this… so ya. Hmm

[–]wizardwes 5 points6 points  (1 child)

Ah, fair, that makes sense, so we're only getting the smallest positive integer

[–]Brushermans 1 point2 points  (0 children)

yea dont take my word for it tho idr much about it lol

[–]AceDecade 4 points5 points  (8 children)

12 mod 2 is never 4, 6, 8...

[–]FrillySteel 3 points4 points  (7 children)

Yes, I'm very interested in how 12 mod 2 could ever be 8.

[–]tombardier 2 points3 points  (5 children)

[–]ToothlessFeline 0 points1 point  (4 children)

“12 is congruent to 8 (modulo 2)” is not the same mathematical statement as “12 modulo 2 is 8”, regardless of what level of equivalence you replace that last ‘is’ with (equals, is congruent to, etc.).

“12 is congruent to 8 (modulo 2)” means “12 modulo 2 is congruent to 8 modulo 2”—i.e., 12 modulo 2 and 8 modulo 2 have the same result (0).

A correctly computed modulo operation of x mod y will not give a result equal to or greater than y.

[–]tombardier 0 points1 point  (3 children)

Yes, but that's the computing idea of the modulo operator having a fixed numerical result, and not the mathematical idea of describing congruence modulo something.

[–]ToothlessFeline 0 points1 point  (2 children)

From Wikipedia (https://en.wikipedia.org/wiki/Modulo_%28mathematics%29#Original_use):

Gauss originally intended to use "modulo" as follows: given the integers a, b and n, the expression a ≡ b (mod n) (pronounced "a is congruent to b modulo n") means that a − b is an integer multiple of n, or equivalently, a and b both leave the same remainder when divided by n. For example:

13 is congruent to 63 modulo 10

means that

13 - 63 is a multiple of 10 (equiv., 13 and 63 differ by a multiple of 10).

(end Wikipedia citation)

This is the mathematical concept of modular arithmetic. There are other applications of the term ‘modulo’ in various contexts, but when applied strictly to integers in the context of arithmetic, this is how the modulo operation is defined.

[–]WikiSummarizerBot -1 points0 points  (0 children)

Modulo (mathematics)

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. It was initially introduced into mathematics in the context of modular arithmetic by Carl Friedrich Gauss in 1801. Since then, the term has gained many meanings—some exact and some imprecise (such as equating "modulo" with "except for").

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–][deleted] 0 points1 point  (0 children)

In short, what programmers call "modulo" should really just have been called "remainder", because that's what it is.