Post Reply 
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
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
Find all posts by this user
Quote this message in a reply
04-07-2015, 04:52 PM
Post: #2
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.
Find all posts by this user
Quote this message in a reply
04-07-2015, 04:56 PM
Post: #3
RE: Problems with signs law and other arithmetic operators
And so does the Prime in textbook and Algebraic modes.
Find all posts by this user
Quote this message in a reply
04-07-2015, 05:09 PM
Post: #4
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.
Find all posts by this user
Quote this message in a reply
04-07-2015, 05:51 PM
Post: #5
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'.
Find all posts by this user
Quote this message in a reply
04-07-2015, 06:13 PM
Post: #6
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.
Find all posts by this user
Quote this message in a reply
04-07-2015, 09:40 PM (This post was last modified: 04-07-2015 09:54 PM by compsystems.)
Post: #7
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
Find all posts by this user
Quote this message in a reply
Post Reply 




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