3 ms·
I learned arithmetic at a young age, yes (and I taught myself BASIC when I was 5-6ish). My main objection to prefix notation for arithmetic is that it's cumbers
by silentbicycle 16y ago
I learned arithmetic at a young age, yes (and I taught myself BASIC when I was 5-6ish). My main objection to prefix notation for arithmetic is that it's cumbersome. Mostly because if the arity of ops aren't predefined (e.g., + isn't limited to 2 arguments), parenthesis are needed for grouping.
Infix, w/ order of op:
y^2*(6x^3 - 3x^2 + 2x - 9)
Prefix:
(* (^ y 2) (+ (* 6 (^ x 3)) (* -3 (^ x 2)) (* 2 x) -9))
Infix, no order of op:
y^2*((6* x^3) - (3* x^2) + (2* x) - 9)
But as long as we're talking polynomials, J wins, IMHO:
(y^2)*+/_9 2 _3 6*(x^i.4)