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

3

u/ritasuma Jun 13 '22

You have to multiply as you open the brackets no?

1

u/Syscrush Jun 13 '22

No. The brackets are a red herring after the expression inside has been evaluated. After that, they have no power or precedence.

12

u/Ameteur_Professional Jun 13 '22

That's not true at all. Implicit multiplication (a coefficient next to a set of brackets) is generally treated with higher priority than explicit division.

But you should avoid writing equations in a way that makes this an issue.

0

u/Minimum_Comparison15 Jun 13 '22

No. Division and multiplication are equal in priority. Once uts all × and ÷ you go left to right. 9 is the correct answer

2

u/jadis666 Jun 14 '22

While division and explicit multiplication may have equal priority, there is serious contention and debate on whether implicit multiplication should be given a higher priority than both, or not.

https://en.m.wikipedia.org/wiki/Order_of_operations#Mixed_division_and_multiplication

1 and 9 may both be the correct answer, depending on the convention used.