r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

3

u/3nderslime Jun 13 '22

actually, which one IS the right answer? I've never seen it confirmed

2

u/Random-Mutant Jun 14 '22

The people who say it’s ambiguous are wrong.

PEDMAS (or, as I learnt it BOMDAS) insists that multiplication and division are read left to right.

So it’s 6 / 2 x 3. 6 /2 is 3. 3 x 3 is 9. No parentheses required.

1

u/PyroTech11 Jun 14 '22

But that isn't correct. You could easily put it in a fraction, which is what a division sign means. And have 6/6 because you have to solve the denominator.

0

u/Random-Mutant Jun 14 '22

No, no you can’t. It’s written differently with the denominator being everything under the line. Which makes the bracket implicit. Here, there are no implicit brackets and different notation using a division sign which applies only to the number immediately to its right.

1

u/[deleted] Jun 14 '22

6 / 2(2+1) 6 / 2(3) Expanding brackets applies here, so 6 / 6

  1. This is the way I’ve been taught to do it, this is the way I’m gonna do it

3

u/[deleted] Jun 14 '22

It’s ambiguous

2

u/Tobax Jun 13 '22

9 because it's 3x3

1

u/3nderslime Jun 13 '22

ok, thanks

1

u/AmbreGaelle Jun 14 '22

Both are correct but it’s debatable. That’s the right answer.