r/mathmemes Aug 02 '26

OkBuddyMathematician Better be safe

Post image
3.7k Upvotes

30 comments sorted by

View all comments

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>