Post Reply 
Logical NOT
06-08-2015, 01:32 AM
Post: #1
Logical NOT
There seems to be an error with logical NOT (and other logicals) in CAS. The ToolBox shows "NOT" with capital letters, but when selecting it from CAS, transforms to lower case letters ("not"). In lower case in CAS it does not work (returns error).
Find all posts by this user
Quote this message in a reply
06-08-2015, 06:47 AM
Post: #2
RE: Logical NOT
(06-08-2015 01:32 AM)Alberto Candel Wrote:  There seems to be an error with logical NOT (and other logicals) in CAS. The ToolBox shows "NOT" with capital letters, but when selecting it from CAS, transforms to lower case letters ("not"). In lower case in CAS it does not work (returns error).

Lowercase "not" does work in CAS, but then it requires parentheses (contrary to what the help screen says), like this:

not(5) --> 0.
not(0) --> 1.

This split personality of NOT/not in CAS is also found in other functions, e.g. the XOR/xor function in CAS:

1 XOR 2 --> 0 (ok)
xor(1,2) --> 0. (ok)
1 xor 2 --> error
XOR(1,2) --> error

Needless to say, the HP Prime has many personality quirks, unlike us perfectly balanced humans. Wink

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-08-2015, 03:11 PM
Post: #3
RE: Logical NOT
Thank you for the illustration. Now that I look at your examples I see that there is some pattern to it: lower case uses functional form like xor(1,0) and upper case uses infix form 1 XOR 0.
Find all posts by this user
Quote this message in a reply
06-10-2015, 05:42 AM
Post: #4
RE: Logical NOT
(06-08-2015 03:11 PM)Alberto Candel Wrote:  Thank you for the illustration. Now that I look at your examples I see that there is some pattern to it: lower case uses functional form like xor(1,0) and upper case uses infix form 1 XOR 0.

That's sometimes true, but don't rely on it. For example, INTERSECT is vice versa: it only allows infix form when spelled in lowercase (CAS only), and prefix form when spelled in uppercase (both CAS and Home)! Another strange "case": CAS only allows prefix syntax for the AND function if it's spelled with mixed case: And(1,2). You really gotta try all three spelling variations for each function to be sure. And you can't memorize them either, because they sometimes change when the firmware is revised. And of course none of this is documented. PPL is a moving target wearing camouflage, which is fun when you're hunting for sport but frustrating when you're hunting to survive.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-10-2015, 03:19 PM
Post: #5
RE: Logical NOT
There you go; I thought I had found something.
Thanks again!
Find all posts by this user
Quote this message in a reply
06-10-2015, 06:18 PM
Post: #6
RE: Logical NOT
1 OR 1 → true ok
1 OR 0 → true ok
2 OR 2 → true ok
-2 OR -2 → true ??? → false
true OR true → true ok
true OR false → true ok
true XOR false → 1 ??? → true
-1 XOR 1 → 1 ??? → true
NOT true → false
NOT false → true
Find all posts by this user
Quote this message in a reply
Post Reply 




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