Post Reply 
Order of operations - what is 6÷2(1+2) ?
12-13-2020, 09:01 AM (This post was last modified: 12-13-2020 09:02 AM by toml_12953.)
Post: #42
RE: Order of operations - what is 6÷2(1+2) ?
(12-12-2020 01:55 PM)ijabbott Wrote:  
(12-12-2020 04:58 AM)toml_12953 Wrote:  Yes, to most programmers I know it means (x/2)*y.

Programmers, perhaps, but what about programming languages? Most would treat x/2y as a syntax error, and x/y2 as division of two variables x and y2 (except those primitive languages that only allow single letter variable names).

Syntax error is exactly why programmers put the missing multiplication sign in there.

x/2y becomes x/2*y

If the author wanted x/(2*y) (s)he should have used parentheses or a textbook notation

Code:
   x
________
  2y

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Order of operations - what is 6÷2(1+2) ? - toml_12953 - 12-13-2020 09:01 AM



User(s) browsing this thread: 3 Guest(s)