Post Reply 
Order of operations - what is 6÷2(1+2) ?
01-04-2021, 04:28 AM
Post: #81
RE: Order of operations - what is 6÷2(1+2) ?
(01-04-2021 04:16 AM)WrongWay Wrote:  -2^2 on the 41CV evaluates to 4

You’re probably doing

2 CHS x^2

That’s (-2)^2

If you want -2^2 then the right keystrokes sequence should be

2 x^2 CHS
Find all posts by this user
Quote this message in a reply
01-04-2021, 05:52 AM
Post: #82
RE: Order of operations - what is 6÷2(1+2) ?
Or the respondent is being a bit of a smart ass Smile. Agreed though, there is no room for ambiguity. you need to be clear if you want -(2)^2 or (-2)^2. Happy new year to all.
Find all posts by this user
Quote this message in a reply
01-04-2021, 03:39 PM
Post: #83
RE: Order of operations - what is 6÷2(1+2) ?
(01-04-2021 04:26 AM)rprosperi Wrote:  If the equation is ambiguous and precedence rules are not provided, a 'correct' answer is not possible, and it probably means someone is trying to lure you in to a conversation like this one. Smile

Code:


TryAPL Version 3.4.1 (Dyalog version 18.0)
Mon Jan 04 2021 07:31:33
Copyright (c) Dyalog Limited 1982-2021
      -2*2
¯4
       ¯2*2
4
What other languages disambiguate such expressions by providing a separate symbol for a negative value?

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: