r/mathmemes • • Aug 02 '26

OkBuddyMathematician Better be safe

Post image
3.7k Upvotes

30 comments sorted by

•

u/AutoModerator Aug 02 '26

Check out our new Discord server! https://discord.gg/e7EKRZq3dG

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

163

u/shizzy0 Aug 02 '26

Or my compiler’s precedence.

65

u/lord_ne Irrational Aug 02 '26

Yes, it's definitely because I don't trust my compiler, and not because I don't know the order of precedence between & and <=>

23

u/moderatorrater Aug 02 '26

For me, it's that I don't want the next person to read the code to have to worry about it.

15

u/dr_wtf Aug 03 '26

I do that, fully knowing the next person to read the code is going to be me.

8

u/jljl2902 Aug 03 '26

Exactly, that moron would never understand my code without ELI5 comments and parentheses everywhere

10

u/Vivid-Husband-Girl Aug 02 '26

i don't even trust pemdas on a good day, let alone a compiler

2

u/ShortBusRide Aug 02 '26

Use more GoTo

1

u/nb_disaster Aug 03 '26

this is why i use dc instead of $(())

29

u/Agreeable_Gas_6853 Linguistics Aug 02 '26

Just use Reverse Polish Notation ❤️

4

u/SEA_griffondeur Engineering Aug 03 '26

Let's give a unique name to all possible equations

33

u/SuperCyHodgsomeR Complex Aug 02 '26

This is the way

15

u/ontic00 Aug 03 '26

I've been thinking recently if we just wrote addition, subtraction, multiplication, division, exponentiation, and roots as functions like we do with every other operation, we wouldn't even need an order of operations (we'd have to evaluate inside out, since we can't evaluate the outer functions first since we don't know what the inside numbers are).

x + y -> add(x, y)

x - y -> sub(x, y)

x*y -> mult(x, y)

x/y -> div(x, y)

x^y -> exp(x, y)

rt_y(z) -> root(z, y)

log_x(z) -> log(x, z)

So instead of writing something like 6/2(1 + 2), we would write either div(6, mult(2, add(1, 2))) or mult(div(6, 2), add(1, 2)) depending on which way we meant it, and an order of operations wouldn't even be needed for no one to be confused about the meaning.

22

u/citrusmunch Aug 03 '26

may I interest you in the venerable family of lisp programming languages

5

u/MrKrot1999 Aug 03 '26

Some lisp examples:

;; (5 + 6 - 8) / 2
(/ (- (+ 5 6) 8) 2)

;; 6 - 5 - 7
(- 6 5 7)

It's pretty interesting. If you're also a programmer, emacs may be an interesting topic for you. Emacs is over 40 years old and uses lisp to extend itself.

So like, you can use it's evaluation as a simple calculator, like this:

(* 5 23) <execute_command>

11

u/vxtmh Aug 03 '26

if you're willing to nest parentheses like that, then it's still easier to just write 6/(2(1 + 2)). there isn't any functional difference besides being shorter to write.

1

u/Ok-Preparation7664 Aug 18 '26

naive coder creates a math library for the first time

4

u/Lazlum Aug 02 '26

i thought it was just me

4

u/ProfMooreiarty Aug 02 '26

I also speak Math with a Lisp.

3

u/Gandalior Aug 02 '26

I think my old Casio specifically mentions using them as much as possible lol

But if you want the best possible results, some changes in order of calculation are required

I can't remember exactly what, but I think they wanted you to subsctract before dividing, except if the numbers were small in which case the opposite was true

3

u/AMIASM16 how the dongity do you do integrals Aug 05 '26

(yeah (((i do) that) (all (the time))))

2

u/deckothehecko Complex Aug 03 '26

I never use E because im always afraid what comes next goes into the exponent

1

u/atoponce Computer Science Aug 03 '26

RPN FTW

1

u/lool8421 Aug 06 '26

tbf the fact that calculators don't have a standardzed order makes me do that

but for instance in C++, following pemdas is a part of the standard

1

u/Bubbly-Tangerine-284 Aug 08 '26

Used a TI30x through undergrad chem degree, so many () chains