Order of operations - what is 6÷2(1+2) ?
01-04-2021, 04:28 AM
Post: #81
 Gerson W. Barbosa Senior Member Posts: 1,589 Joined: Dec 2013
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
01-04-2021, 05:52 AM
Post: #82
 WrongWay Junior Member Posts: 43 Joined: Dec 2020
RE: Order of operations - what is 6÷2(1+2) ?
Or the respondent is being a bit of a smart ass . 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.
01-04-2021, 03:39 PM
Post: #83
 mfleming Senior Member Posts: 943 Joined: Jul 2015
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.

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."
 « Next Oldest | Next Newest »

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