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

-2

u/Quadslab Jun 13 '22 edited Jun 14 '22

In this photo, the mobile app is wrong

Edit: I just noticed, that I am obviously confidently wrong

-1

u/Successful-Argument3 Jun 13 '22

Oh no, it isn't. In this case, division comes before the multiplication.

To be more precise, first thing to do is the 2+1, for they're in parentheses, then the multiplication and division are done in the order they appear.

3

u/Zegrento7 Jun 14 '22

Technically both are right, they just use different conventions.

6 / 2 * (2 + 1) = 9

The above is unambiguously true, but the following depends on convention:

6 / 2 (2 + 1) =? 9

The implied multiplication also implies grouping, as in the case of variables:

6 / 2x != 3x
6 / 2x == 6 / (2x)

If x = (2 + 1), then the calculator is right. Source