Problems with signs law and other arithmetic operators
04-07-2015, 04:36 PM (This post was last modified: 04-07-2015 09:49 PM by compsystems.)
Post: #1
 compsystems Senior Member Posts: 1,260 Joined: Dec 2013
Problems with signs law and other arithmetic operators
HPPRIME
+2/+2 => 1 ok
+2*+2 => 4 ok
+2*-2 => -4 ok
-2*-2 => 4 ok
5-+6 => -1 ok
5+-6 => -1 ok
5++6 // error => 11
5--6 // error => 11

In MATLAB ok
>>
+2/+2
+2*+2
-2*-2
5-+6
5+-6
5++6
5--6

ans1 = 1
ans2 = 4
ans3 = -4
ans4 = -1
ans5 = -1
ans6 = 11
ans7 = 11
04-07-2015, 04:52 PM
Post: #2
 Gerald H Senior Member Posts: 1,448 Joined: May 2014
RE: Problems with signs law and other arithmetic operators
Don't know why you wanted to try these expressions - HP 50G returns same results as you quote for MATLAB.
04-07-2015, 04:56 PM
Post: #3
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Problems with signs law and other arithmetic operators
And so does the Prime in textbook and Algebraic modes.
04-07-2015, 05:09 PM
Post: #4
 DrD Senior Member Posts: 1,132 Joined: Feb 2014
RE: Problems with signs law and other arithmetic operators
(04-07-2015 04:36 PM)compsystems Wrote:  5++6 // error
5--6 // error

I get correct results for the two expressions that you've shown as error.

5+ +6 displays in history as 5+6, and Ans(1) = 11. (Note I inserted a space between the two plus signs, to clarify that the 6 has a positive symbol).

5--6 Uses the subtraction sign after the 5 and the negative sign preceding the 6 to also result in Ans(1)=11. It's not clear in this posting that the 6 has the negation symbol, from the [+/-] button, for example. However, the Prime display shows that the negation symbol is smaller than the minus symbol.
04-07-2015, 05:51 PM
Post: #5
 Gerald H Senior Member Posts: 1,448 Joined: May 2014
RE: Problems with signs law and other arithmetic operators
(04-07-2015 05:09 PM)DrD Wrote:
(04-07-2015 04:36 PM)compsystems Wrote:  5++6 // error
5--6 // error

I get correct results for the two expressions that you've shown as error.

5+ +6 displays in history as 5+6, and Ans(1) = 11. (Note I inserted a space between the two plus signs, to clarify that the 6 has a positive symbol).

5--6 Uses the subtraction sign after the 5 and the negative sign preceding the 6 to also result in Ans(1)=11. It's not clear in this posting that the 6 has the negation symbol, from the [+/-] button, for example. However, the Prime display shows that the negation symbol is smaller than the minus symbol.

Not so on 50G - between ' ' two subtracts are allowed eg '5--6'.
04-07-2015, 06:13 PM
Post: #6
 Wes Loewer Member Posts: 260 Joined: Jan 2014
RE: Problems with signs law and other arithmetic operators
(04-07-2015 04:36 PM)compsystems Wrote:  5++6 // error
5--6 // error

Since the CAS interprets n++ and n-- as increment and decrement (kind of like C), perhaps 5++ is parsed as incrementing 5, thus causing an error.
04-07-2015, 09:40 PM (This post was last modified: 04-07-2015 09:54 PM by compsystems.)
Post: #7
 compsystems Senior Member Posts: 1,260 Joined: Dec 2013
RE: Problems with signs law and other arithmetic operators
5+ SPC +6 => 11 OK
5- SPC -6 => 11 OK

Where is the information to use the +, -, ++, -- operator?, some of my classmates who bought the hpprime are disappointed that no information as hpprime works, without documentation we have to guess.
Please HPPrime TEAM complete catalog help

NOW with − as sign /!\ ASC("−") = 8722 the command should be called Unicode() and non-ASCII ASC()

−−6 => 6 ok
−+6 => -6 ok
5-−6 => 11 ok

5▶x
x++ => 6 ok
x-- => 5 ok

--x => ERROR
++x => ERROR

And not say what type of error, it is necessary to clearly define the errors displayed on screen, not only display an icon of (X) with the input typed in the input line.

All power calculator is lost in these bit details
 « Next Oldest | Next Newest »

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