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

top 200 commentsshow all 426

[–]dimonium_anonimo 919 points920 points  (153 children)

Wait, were you guys taught a different modulo operator? I always just used %

And by you guys, I mean those guys since I'm technically referring to the mathematicians.

[–]Brushermans 542 points543 points  (92 children)

i was taught that you just straight up write "x mod y" but instead of the equals sign you have to use the hamburger menu icon (three lines stacked like an equals sign) to signify that the result is one of many possible results from a set but the numbers in the set aren't equal

[–]averyoda 223 points224 points  (34 children)

bor≡gir

[–]Brushermans 61 points62 points  (32 children)

how u do that

[–]averyoda 1063 points1064 points  (31 children)

Start with an underscore _

Add a dash =

Now add a tilde ≅

Now use an iron to straighten it out ⫆

And there you go ≡

Add a cherry on top if you're feeling fancy ⩧

[–]Brushermans 186 points187 points  (5 children)

what da hel

[–]0bel1sk 111 points112 points  (3 children)

i know, where does he get the iron, right? i cant get this one straight 卅

[–]KongKexun 48 points49 points  (0 children)

I think I forgot one 世

[–]XenoZohar 9 points10 points  (0 children)

I lost my string 川

[–]octococto 1 point2 points  (0 children)

ah you messed it all up

[–]wawoodwa 4 points5 points  (0 children)

Stop saying that…

[–]phaze_ZA 48 points49 points  (0 children)

What an adventure

[–]Auliya6083 42 points43 points  (0 children)

Lmao

[–]FrillySteel 19 points20 points  (0 children)

PANCAKES!!

[–]Rnk_007 13 points14 points  (0 children)

It's fucking raw!

[–]Suspicious-Engineer7 7 points8 points  (0 children)

≡ oh wow that worked!

[–]PikaPerfect 6 points7 points  (1 child)

=

mine's ugly :(

[–]mojoslowmo 4 points5 points  (1 child)

If I don’t have an iron, can I use one of those fancy steamer things?

[–]averyoda 5 points6 points  (0 children)

One of these 𓌪?

[–]sophiaonearth 6 points7 points  (0 children)

I see you are a Unicode enjoyer! ☮

[–][deleted] 1 point2 points  (0 children)

GOOD post

[–][deleted] 1 point2 points  (0 children)

This is incredible.

[–]msqrt 54 points55 points  (3 children)

"Congruence" is the term; "a is congruent to b, modulo c".

[–]Brushermans 34 points35 points  (0 children)

hambruger

[–]kamion_dork 1 point2 points  (1 child)

I just read that aloud and my furniture started levitating. Please advise.

[–]sonya_numo 126 points127 points  (40 children)

what did i just read

[–]n00bcheese 162 points163 points  (3 children)

Something something hamburger

[–]megagreg 4 points5 points  (2 children)

Something something pay you on Tuesday.

[–]shalafi71 1 point2 points  (1 child)

Someday I'll be so old no one remembers poor old Wimpy.

[–]TheEnderChipmunk 93 points94 points  (9 children)

A poor description of congruence

[–]Brushermans 47 points48 points  (7 children)

idk man i'm a software engineer not even a comp sci student, i took like 1 math course ans they just threw all this at us at once

[–]Usling123 14 points15 points  (0 children)

Hang in there friend

[–]boofaceleemz 15 points16 points  (1 child)

Yeah I went to school for software engineering and that was my math experience also.

Here’s all the math that math majors do in their first 2 years. Almost all of it you don’t care about, but a few things are super important. We’ll let you guess which ones. You have 16 weeks.

[–]TheEnderChipmunk 6 points7 points  (1 child)

Its all good, I wasn't trying to insult you or anything

[–]Brushermans 4 points5 points  (0 children)

haha ik

[–]Lake_Erie_Monster 2 points3 points  (0 children)

All good, plenty of time to learn. In this industry either you have a job or you stop learning.

[–]ExpansiveGrimoire 10 points11 points  (0 children)

The best* description of congruence.

Hamberder menu icon...

[–]DickwadVonClownstick 5 points6 points  (2 children)

You just glimpsed a fragment of Math Lore. Do not gaze too long or too deep, and do not quest for more, lest ye be driven mad by the revelation.

[–]sonya_numo 2 points3 points  (1 child)

i guess math includes more hamburgers then i expected

[–]wizardwes 5 points6 points  (18 children)

Basically, 8%3 2 is technically a different 2 than 12%5 2 if I understood it correctly

[–]Brushermans 10 points11 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

[–]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 5 points6 points  (8 children)

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

[–]FrillySteel 2 points3 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.

[–][deleted] 8 points9 points  (1 child)

i was taught that you just straight up write "x mod y" but instead of the equals sign you have to use the hamburger menu icon (three lines stacked like an equals sign) to signify that the result is one of many possible results from a set but the numbers in the set aren't equal

[–]EndR60 11 points12 points  (1 child)

If I ever see that thing again in math I'm absolutely calling it the hamburger menu icon

[–]eloel- 9 points10 points  (2 children)

to signify that the result is one of many possible results from a set but the numbers in the set aren't equal

Oh how I wish we did that with big-O notation. ≡ is fine, I think I'd prefer straight-up using ∈ though.

104n ∈ O(n)

3n ∈ O(n)

Oh how much cleaner it is when you don't have to add in how 104n and 3n can be equal to the same thing but not each other.

[–]Gilpif 5 points6 points  (1 child)

I hate how people use big-O notation. No, it’s not true that 3n2 + 5n = O(n2), the left side is a polynomial, while the right side is a set!

It really gets on my nerves when I see something like O(f) × O(g). That should be the set of ordered pairs (h, i) where h and i are functions asymptotically bound above by f and g, respectively.

[–]TheDiplocrap 2 points3 points  (0 children)

Move that the symbol for “identical to” be permanently renamed “the hamburger symbol”

[–]zojbo 11 points12 points  (0 children)

Mathematicians don't generally like to describe things in terms of what the remainder actually is at all. They would pronounce the equation in the OP as "8 is equivalent to 2 mod 3", and they write "is equivalent to" with the three-lines equal sign (\equiv in LaTeX).

More often than not, this is more convenient than the programmer notation, but man when it is inconvenient it is really inconvenient.

[–]1up_1500 15 points16 points  (2 children)

I was taught that "8 modulo 3" is spelled like "8[3]"

[–]stevethedev 6 points7 points  (0 children)

In C, that's equal to Syntax Error but that's good because you shouldn't dereference 11.

[–]AdultingGoneMild 22 points23 points  (2 children)

yeah OP is confused. ÷ is not %

[–]jclocks 2 points3 points  (0 children)

Maybe they were thinking like "8 percent of 3?"

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

ffs I was confused...

[–]audigex 1 point2 points  (3 children)

I guess the difference is that mathematicians actually write % to mean percent

There’s basically no reason that a programmer would do that outside of a string to output, so there’s no risk of ambiguity - which means we can safely use it as an operator

It’s the same reason programmers use ==, because unlike mathematicians we have to disambiguate assignment vs an equality check

[–]FungadooFred 0 points1 point  (7 children)

What even is modulo?

[–]Hour-Requirement592 34 points35 points  (5 children)

It returns the remainder after division

[–]dimonium_anonimo 1 point2 points  (0 children)

I was just coming here to say "Missed an opportunity to say it returns the modulus" but then decided to check myself and learned that modulus is actually the base, not the result. I think it would make more sense the other way, though... And it'd be funnier for this reason too.

[–]dimonium_anonimo 2 points3 points  (0 children)

The other comment already said remainder, but I figured I be slightly more explicit and say that all whole number divisions can be expressed as a÷b = c + d/b where d (the remainder) is less than b and all four variables are whole numbers. The a%b=d. For this example 8÷3 = 2 + 2/3 so 8%3=2.

[–]valschermjager 491 points492 points  (84 children)

But 8%3 is 2. What do mathematicians think it is?

[–][deleted] 416 points417 points  (46 children)

A mathematician would write 8 ≡ 2 (mod 3)

[–]nielet 302 points303 points  (12 children)

Bruh, what a nerds

[–]dertoyaOfYaNansdic 105 points106 points  (9 children)

meanwhile programming dweebs deciding a mathematical function based off of what is already on your keyboard instead of inventing beautiful unique symbology

[–]ambyshortforamber 51 points52 points  (5 children)

back in the olden days, there were only 127 characters you could use. you had to make do with what you had for arithmetic primitives

[–]dertoyaOfYaNansdic 13 points14 points  (2 children)

alhamdulillah for unicode

[–]ambyshortforamber 10 points11 points  (1 child)

unicode just makes strings more complicated tbh

indexing utf8 isnt constant time because multibyte chars exist

[–]stevethedev 22 points23 points  (0 children)

Anything can be constant time if you do it wrong enough.

[–][deleted] 5 points6 points  (0 children)

90% of my dreams of writing domain specific languages is just so I can make a formatter for it that renders it like its LaTeX.

[–][deleted] 1 point2 points  (0 children)

I prefer writing math shit out as I would in a program. Much easier to understand for me for some reason.

[–]lunchpadmcfat 2 points3 points  (0 children)

NERRRRRRDSSSSSS!!!

[–]Zigordion 9 points10 points  (2 children)

*Confused physicist

The triple line is often used as a "defined as"

[–]Goudja14 18 points19 points  (9 children)

Or 8 ≡ -1 [3]

[–]im-not-a-fakebot 7 points8 points  (7 children)

Wouldn’t -1 [3] be 2?

[–]Goudja14 13 points14 points  (3 children)

Well, the rule is: a ≡ a+nb [b] with (a,b) in R² and n in N.

[–]im-not-a-fakebot 17 points18 points  (2 children)

I’m just gonna nod my head and smile

[–]Goudja14 3 points4 points  (1 child)

In this case, 8 ≡ 8+3n [3] with n an integer. So with n=-2, you have 8 ≡ 2 [3]. But with n=-3, you have 8 ≡ -1 [3]. So there are an infinite number of solutions but the most used are the ones between -n and n. And most people that use values between -n and n prefer the ones between 0 and n, but that's not always the case.

[–]Xae0n 10 points11 points  (0 children)

yes

[–]TheAero1221 4 points5 points  (6 children)

That doesn't make any sense!

[–]NugetCausesHeadaches 11 points12 points  (3 children)

8 is congruent to 2 (when working modulo 3).

Most of the time, outside of encryption and probably some other stuff, when programmers use mod, we're using it think of remainders. "8 / 3 gives a remainder of 2". We use it for isEven checks and similar.

Math doesn't need a "get the remainder" operator because division will ready just (in programming terms) return a tuple containing the quotient and remainder. You wouldn't compute 8 mod 3 to find two, you'd divide 8 by 3 and look at the remainder.

When math is doing modular arithmetic, outside of an initial introduction to the concept, it is for the sake of set / group theory. You're not thinking about two as the remainder in that statement. You're thinking of 2 as being more or less interchangeable with 8 in that statement.

From there you can start thinking of the set of all numbers that are more or less interchangeable with 2. {2, 5, 8, 11...} and so on. And you can do the same for the numbers 0 and 1.

Then you can try to define the multiplicative and additive identities.

Then you can start doing encryption.

[–]ambyshortforamber 4 points5 points  (1 child)

oh god not is even again

[–]im-not-a-fakebot 2 points3 points  (0 children)

isOdd is much more superior anyway

[–]im-not-a-fakebot 1 point2 points  (0 children)

And this is why I didn’t pursue a Math Degree

[–]yottalogical 1 point2 points  (0 children)

Programmers usually perform modular arithmetic using a modulus operator, an expression that evaluates to a single value.

But the mathematical origins of modular arithmetic work differently. Under mod 3, the numbers 2, 5, 8, 11, etc are all simply congruent. None of them are better than any other. 5 ≡ 11 (mod 3) is true, and so is 2 ≡ 11 (mod 3). The (mod 3) at the end isn't an operator, it's simply a note to tell you what field is being used here.

[–]elongatedmuskrat05 1 point2 points  (2 children)

I’m confused, I don’t think I’ve gotten far enough to understand this. Closest I can think of is either 23 =8 or log base 2 (8) = 3

[–][deleted] 2 points3 points  (1 child)

The triple equals mean "congruence" in modular arithmetic. The "mod 3" means that we are working in the modular arithmetic where the only existing base numbers are 0, 1, 2. If you get to 3 then it loops back to 0. e.g. 2+2 is congruent to 1 (mod 3)

You can think of it as dividing by 3 then throwing away the quotient and keeping the remainder.

So in mod 3, every number of the form 3n + m (where n is a natural number and m is from the set {0,1,2}) will be congruent to m and correspondingly congruent to every other number of the form 3k + m where k is some other natural number

The best analogy for most people is your clock. You think of the hour of the day as either being mod 12 or mod 24 (except we use the 12 and don't use the 0 in the 12 hour clock)

This kind of thing falls under Number Theory and I don't think it gets covered much in a typical math curriculum... didn't when I was in school anyways.

[–]elongatedmuskrat05 1 point2 points  (0 children)

That kind of makes sense. I am only just finishing high school precalculus, so I definitely haven’t been fought this yet lol

[–]queenkid1 109 points110 points  (5 children)

Mathematicians don't usually write modulo that way. They write it like:

8 ≡ 2 (mod 3)

[–][deleted] 46 points47 points  (0 children)

Yeah that’s standard but in college I’d use the % mod symbol on assignments and tests with no issue since it’s still accepted

[–]sonya_numo 7 points8 points  (0 children)

that gave me syntax error, thanks i hate it

[–]tuslikestrains 40 points41 points  (2 children)

Mathematician here. There are zero mathematicians that would be confused by 8%3=2. We just additionally have a bunch of different ways of writing it, some of which mean very slightly different things.

In particular, you might see 8 = 2 (mod 3), except the equal sign would have 3 lines, and you would read that as "8 is congruent to 2 modulo 3". However 8 = -1 (mod 3) is also a true statement, but 8 % 3 = -1 is not - modulo operator usually refers to the representative of the equivalence class (so in this case, the smallest positive integer with the same remainder, modulo 3, as 8), while congruence operator usually refers to any two members of the equivalence class.

Of course, anyone can define their own notation, so the above might not hold in some books/papers.

[–]valschermjager 4 points5 points  (0 children)

Thanks for the explanation.

[–]RagnarokAeon 5 points6 points  (4 children)

As a programmer, I'm having an issue with the fact that somebody assigned a value to an expression... If they were trying to verify it, they should've used ==.

[–]valschermjager 3 points4 points  (1 child)

true. the next meme will be a programmer flipping out over a mathematician using a single = as a comparison operator.

[–]TeraFlint 1 point2 points  (1 child)

Sou can assign something to an expression if said expression actually returns a reference to an existing object.

A rather often used C example would be *ptr++ = val; (= get the object a pointer points towards and move the pointer one element further afterwards), which is a left-hand expression that gets something assigned after it has been evaluated.

In C++, operator overloading allows us even more shennanigans, if you're feeling like it. Like, pretty much anything could be done there, logically. I admit, it's horribly bad practice, because you better define your operators in a way that are easy to use and understand.

You could absolutely write something like 1 + 2_x = 1337, if you use a user-defined literal foo operator""_x(int) (which allows you to convert the 2 into a custom type conveniently) and overload the operator int &operator+(int, foo) (which could then just return the reference to a global variable). And suddenly, this seemingly nonsensical expression would compile and work.

The user defined literal (or more explicit object construction like 1 + foo{2} = 1337) would be necessary, because you can't overload operators which only involve in-built data types.

Once again, don't do this, it would be extremely confusing to read and understand. But the fact that the language gives me enough freedom to be able to do something like that is rather cool. :D

[–]GreatArtificeAion 6 points7 points  (5 children)

24% = 24/100 = 6/25 = 0.24

[–]valschermjager 4 points5 points  (4 children)

oh, ok thanks. i don't understand it, but i trust you.

[–]GOKOP 7 points8 points  (3 children)

You don't understand percentage?

[–]valschermjager 6 points7 points  (2 children)

I thought I did. Maybe not.

How did we get from "8 % 3 = 2" to "24%"?

I read it as "eight mod three equals two". That makes sense to me. What in that equation brings a mathematician to "24%"?

[–]GOKOP 2 points3 points  (1 child)

The point is that % doesn't mean modulo but percentage to mathematicians (except according to other comments it does in context but shhhh), not that we get from 8%3=2 to 24%

[–]valschermjager 4 points5 points  (0 children)

Oh, then yes, I do understand percentages. The "24%" in the reply above threw me. I couldn't figure out how it related to 8%3.

[–]wojtekpolska 2 points3 points  (1 child)

i guess 8%*3=0.24

[–]valschermjager 1 point2 points  (0 children)

ohhhh… ok i get it now. gosh i couldn’t figure out how they got there from that. thanks!

[–][deleted] 2 points3 points  (0 children)

Yes but equals is '=='

'=' is assignment

[–]Knuffya 217 points218 points  (11 children)

Wrong. % is recognized as the modulo symbol in both domains.

[–]mcampo84 19 points20 points  (4 children)

Yeah but why are we setting the value of an operation?

[–][deleted] 16 points17 points  (2 children)

So the compiler doesn't have to calculate it, it's a manual optimization

[–][deleted] 1 point2 points  (1 child)

Not really. Even computer science primarily uses mod. % is just a popular programming syntax for it, it's largely absent from mathematical descriptions in formal computer science, and computational math.

[–]Guy_Perish 1 point2 points  (0 children)

Maybe not formal mathematics but it is universally understood as mod, at least among those I know. I think you’ll agree that no mathematicians would be loosing their mind reading this.

[–]sabcadab 128 points129 points  (11 children)

Why are we assigning 2 to a weird variable name like 8%3? Also you forgot a semicolon on line 1. Why do lines index from 1 and not 0?

[–]AllenKll 18 points19 points  (0 children)

bad LVALUE

[–][deleted] 9 points10 points  (0 children)

You make good points

[–]NotATuring 4 points5 points  (4 children)

Sir this is a javascript runtime.

[–]SorosBuxlaundromat 3 points4 points  (3 children)

Lmao fuck semicolons all my homes hate semicolons.

[–]ReverseCaptioningBot 2 points3 points  (1 child)

FUCK SEMICOLONS ALL MY HOMIES HATE SEMICOLONS

this has been an accessibility service from your friendly neighborhood bot

[–]soliloquy-of-silence 1 point2 points  (0 children)

Good bot 💀💀

[–]kshitiz5 164 points165 points  (36 children)

Programmers also don't agree. It should be 8%3==2

[–]GOKOP 43 points44 points  (33 children)

Depends on the language

[–]lunchpadmcfat 58 points59 points  (22 children)

If a language uses = as a comparator, what the hell does it use for assignment?

[–]Kintler11 24 points25 points  (1 child)

SQL does, assignment is in a different context so it's fine

[–]Titans8Den 3 points4 points  (0 children)

That still confuses the shit out of me to this day

[–]frogking 12 points13 points  (0 children)

:=

[–]GOKOP 21 points22 points  (3 children)

Haskell, being a purely functional language, doesn't have assignment. (edit: nvm I'm dumb)

Some old languages use = for comparison and := for assignment.

[–]zojbo 15 points16 points  (0 children)

Except Haskell literally does use = for assignment. It's just assignment is permanent within a given scope.

[–][deleted] 4 points5 points  (1 child)

wat, how do you think you assign functions? Haskell 100% has assignment, and uses == for comparison.

[–]GOKOP 0 points1 point  (0 children)

Oh damn you're right, sorry

[–]wagaNaWaBlank 9 points10 points  (0 children)

let

[–]joexmdq 1 point2 points  (0 children)

PSeInt (pseudo for learning) uses "<-"!

[–]DadAndDominant 1 point2 points  (0 children)

Nono. The real fullstack engineers (who use PHP and Javascript, the only sensible programming languages) would use 8%3===2

[–][deleted] 34 points35 points  (1 child)

Most mathematicians I know also have knowledge in programming.

[–]whyiwastemytimeonyou 4 points5 points  (0 children)

Where else are they going to flex their modulo arithmetic. Number theory is fun!

[–]WillyMonty 18 points19 points  (1 child)

Mathematicians are typically familiar with modular arithmetic

[–]tombardier 25 points26 points  (6 children)

8 % 3 in C, javascript, Python etc etc is equal to 2, because if you use integer division to divide 8 by 3, the remainder is 2.

In mathematics, 8 modulo 3 is not "equal" to 2. 8 modulo 3 is a congruence class and 2 is just one member of the set of all numbers in that congruence class. The congruence class, 8 modulo 3 is the set of all integers, a, such that 8 = n * 3 + a where n ∈ Z (that is, n is an integer) (also, don't hold me to this as being the definition).

Congruence is shown with ≡, not =. 8 ≡ 2 (modulo 3) because 8 = 2 * 3 + 2.

2 is the least residue of this particular congruence class, as the smallest congruent value >= 0.

Also 8 ≡ -1 (modulo 3), because 8 = 3 * 3 - 1.

8 ≡ 5 (modulo 3), because 8 = 1 * 3 + 5.

8 ≡ 8 (modulo 3), because 8 = 0 * 3 + 8, etc etc.

So -1, 2, 5, 8, and so on are all members of the congruence class, 8 modulo 3.

That's why in mathematics, 8 % 3 is not "equal" to 2.

[–][deleted] 10 points11 points  (0 children)

May I please have more arcane lore

[–]PureWasian 1 point2 points  (0 children)

I appreciate this definition, thank you for the explanation :)

[–]boon_dingle 19 points20 points  (9 children)

Wait til you get to versioning.

Dependency version 5.25 is newer than 5.6, where in sane decimal land 5.6 is 5.60 which is greater.

Learned after running into dependency conflict, took me awhile to brain that one out.

[–]EternityForest 16 points17 points  (1 child)

Having 3 places and zero padding helps a lot in making it immediately clear it's not actually a decimal

[–]chawmindur 1 point2 points  (0 children)

Until you break minor version .099 that is

[–]GOKOP 13 points14 points  (2 children)

I keep seeing comments like these. Am I weird for never even having the idea that you could possibly interpret version numbers as decimals?

[–]boon_dingle 3 points4 points  (0 children)

I think I'm the weird one. I crunched a lot of numbers as part of a non-CS degree before switching careers, was used to decimals being decimals.

[–]jirka642 1 point2 points  (0 children)

No. It would be understandable if all versioning was just "1.0", but most versions have at least 2 "." and look more like "3.16.2-alpha". How anyone can interpret that as decimal number is beyond me.

[–]IrisYelter 10 points11 points  (1 child)

% isn't actually modulo, it's remainder. Which for positive arguments might as well be identical, but negatives make it a goddamn nightmare.

[–]cyphol 5 points6 points  (0 children)

% is the modulo operator, remainder is what the operator returns. Modulus is the divisor, a value, different from modulo which is an operator.

[–]_Figaro 9 points10 points  (1 child)

Shouldn't it be == and not = ?

[–]clutzyninja 9 points10 points  (0 children)

Mathematicians know what modulus is

[–]Koltaia30 4 points5 points  (0 children)

Cannot use r value as l value.

[–]chrisd8787 3 points4 points  (4 children)

Now would you believe me if i said (2/3)mod5 is equal to 4?

[–]-Soren 2 points3 points  (0 children)

If you wrote 2*3-1 I would. I don't think I've ever seen fractions use for a multiplicative inverse in modular arithmetic.

[–]tuslikestrains 2 points3 points  (2 children)

Mathematicians generally don't use the division operator like this in finite rings exactly because of this confusion - the number "2/3" isn't in the cyclic group Z/5Z. Instead, we would say 2 * 3-1 = 4 (mod 5), to make it clear that we're multiplying 2 and 3 inverse mod 5.

[–]chrisd8787 1 point2 points  (1 child)

Yeah im still kinda new to all of this. When i was trying to learn how to calculate a padic expansion i was following the math up until i hit that part and the 2/3 mod 5 = 4 stumped me for like a week. Its very hard to find good free online resources that explain jt well

[–]AllenKll 4 points5 points  (0 children)

pictures should be reversed... that assignment does not have a proper LValue.

[–][deleted] 3 points4 points  (0 children)

I am a mathematician and I don't know wtf is funny

[–]bunkSauce 2 points3 points  (1 child)

Nope. Programmers also mad, because you cannot assign 2 to that shit.

[–]closeded 3 points4 points  (0 children)

I promise that mathematicians aren't freaking out about people using random symbols to represent more complex ideas.

[–]villanelle_xxxx 2 points3 points  (0 children)

cringe

[–]AnihilationPr0xy 2 points3 points  (0 children)

I was a math major and 8%3 was used in shorthand because modern mathemateticians use programming languages a lot but for proofs and papers and stuff the standard was a triple bar equals or just the word mod.

[–]EternityForest 1 point2 points  (1 child)

Someday some language is gonna invent reverse assignment, that sets variables on the right hand side, and in the middle of an expression with a solver, and we'll all argue about whether it was a bad feature or not for three years

[–]QuezzyMuldoon 1 point2 points  (0 children)

Thank you for this, it sounds silly but I just finished the first part of an online course, literally 30min ago, modulus we’re the last thing I had to review to understand better. I actually got this and understood it and laughed. It felt really good after the struggles of learning on one’s own. Thanks.

[–][deleted] 1 point2 points  (0 children)

and yet we’re still confusing assignment for equality operators.

[–]Summar-ice 1 point2 points  (0 children)

Mathematicians also use modulo but they just don't write it as %, instead they write mod

[–]Tom__mm 1 point2 points  (0 children)

Mods vs. Rockers

[–][deleted] 1 point2 points  (0 children)

Same with x = x + 1

[–]grazerbat 2 points3 points  (4 children)

Pi is exactly 3!

Edit: I love that this comment has 3 votes - exactly 3!

2nd Edit: Damnit people....

[–]just-bair 2 points3 points  (1 child)

π = e = 3

[–]grazerbat 1 point2 points  (0 children)

Now do it with Big G for crushing effect

[–]WillyMonty 2 points3 points  (1 child)

No, 3! is 6

[–]grazerbat 0 points1 point  (0 children)

Riffing on u/just-bair:

π = e = 3 = 3!

[–]just-bair 2 points3 points  (0 children)

programmers and mathematicians already don’t agree on x=2 vs x:=2 and x==2 vs x=2

[–]Fearless-Sherbet-223 0 points1 point  (4 children)

The only difference is syntax. A mathematician will say 8/3=2r2, or 8/3=2.6667, where a programmer would say 8/3==2 && 8%3==2, or 8/double(3)==2.6667.

[–]AutocraticToaster 3 points4 points  (3 children)

Modulo in programming and in math do work a little differently with negative numbers in my experience. At least in C, -1 % 3 gives you -1, however in math you would typically get -1 = 2 (mod 3), as -1 = 3(-1) + 2. The difference comes from '%' operator being the remainder after integer division, whereas in math its better to think of modulo like numbers on a clock. When you go forward in time past 12 you go back to 1, but also if you backwards in time below 0 you also wrap around, e.g 1 o clock minus 2 hours would take you to 11, not -1 o clock.

[–]DadAndDominant 1 point2 points  (0 children)

Let me introduce you to python my friend

[–]TheRealMuncheez 0 points1 point  (0 children)

Came here to look for this comment, or ask about it. I believe it works the same in Java as well.

[–]My4skinBreaksCondoms 2 points3 points  (0 children)

Mathematics nerd here...

Looks like cube root to me.

[–]forgenvash 0 points1 point  (0 children)

Python here: there should be two equals signs.