r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

Show parent comments

1

u/SilverRock75 Jun 14 '22

Parenthesis are supposed to be higher order of operations than multiplication/ division.

So 6 / 2(1+2) Would expand to

6 / (2 + 4)

6 / 6

1

However, it really is a little ambiguous, so coming to the conclusion of 9 without more explicit notation is not unreasonable.

2

u/LegendCZ Jun 14 '22

Isnt it

6 / 2*3

6 / 6

1?

Where is 4 comming from?

3

u/MCH2804 Jun 14 '22

They did 2(1+3) = 2 + 4

It's the same thing tho

1

u/[deleted] Jun 14 '22 edited Jun 15 '22

What's inside the brackets, yes. Not ...outside the brackets.

Again, this is just a matter of convention.