Can we all agree that polish/prefix notation is objectively superior to infix notation?
silence means assent
>>54823091
No that's stupid and unnecessary
>>54823091
I can agree with that, my brain finds it easier to work with and it's a lot more compact. The only problem is I can't use it in exams for some stupid reason...
>>54823091
Lost a '2' there buddy
>>54823091
No, it's better to have infix notation and 18 levels of operator's precedence.
>>54823091
postfix > prefix
I will agree that both are better than infix though.
Did someone just get done reading the first chapter of SICP?
(* (/ 1 (sqrt (* 2 π ) ) sigma) (exp (* -1/2 (pow (/ (- x µ) sigma ) 2))))
Real superior. There's a reason we don't usually use it.
>>54823091
Your example looks good because it has less operators so it's shorter. But how about this:
(3-5)*((7+2)/9)
Is the same as
(* (- 3 5) (/ (+ 7 2) 9))
I think it looks uglier imho desu senpai
Top one looks like it'd be nice for situations like that one specifically - one operator, a bunch of things to operate on.
Multiple different operations would be a garbled mess to comprehend compared to using the bottom one.
>>54823091
Yeah
>>54823799
>>54823951
Why the fuck would you use parentheses with the polish notiation? The whole point is not having to write them.
>>54823642
Do you also prefer your programming languages to look like (3, 2, 1, "%d %d %d").printLn.stdout
>>54824316
No, there's a place for everything
>>54824298
How would that anon write that equation as you describe it then? The only thing I can see you doing is removing the outmost parentheses.
Seriously curious.
The only way I could think of is this:
* / + 7 2 9 - 3 5
But the only reason it works is because of the Commutative Property of Multiplication.
>>54824734
Basicly just omitting all of them works, so
* - 3 5 / + 7 2 9
works just as well
>>54824734
Are you retarded? Post- and prefix are unambiguous. There are no more than one way to derive them.
>>54824298
because * and + are n-adic functions.
>>54824734
* / + 7 2 9 - 3 5
* / 9 9 - 3 5
* 1 - 3 5
* 1 -2
-2
>>54826021
* - 3 5 / + 7 2 9
* -2 / + 7 2 9
* -2 / 9 9
* -2 1
-2
----------------
Don't ask, I was bored.
>>54826256
Afaik the elementary arithmetic operators are assumed to be binary.
the only thing that matters is getting the right solution to a problem
how you get there doesn't matter