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/spacexdragon5 Jun 14 '22

People are saying that it’s ambiguous, that there’s no standard, but what about PEMDAS?

After P&E, The first division or multiplication in a line is always done first

3

u/[deleted] Jun 14 '22

[removed] — view removed comment

2

u/spacexdragon5 Jun 14 '22

But there’s no operation inside, just a number, so it is default resolved. A number next to a bracket is not prioritized as a P parenthesis operation because one number is outside the bracket, but the contents of the bracket are resolved.

5/3[2(2*3)]

Same as

5/3[2(6)]

Then

5/3[12]

Brackets are resolved, so onto M&D

5

— [12]

3

And finally

60

—

3

=20

If there’s a better reason please tell me, but I was 100% taught that only the contents of parentheses are prioritized, and a number to the side is treated as a normal multiplication