Post Reply 
5 minus minus 6 on in HOME and CAS
07-14-2017, 01:53 AM
Post: #1
5 minus minus 6 on in HOME and CAS
Hi!
In HOME view, 5 - -6 is OK but
in CAS view 5 - -6 show error!
I think this is not a bad math expression.
Marcel
Find all posts by this user
Quote this message in a reply
07-14-2017, 04:51 AM
Post: #2
RE: 5 minus minus 6 on in HOME and CAS
In CAS, it works ok if you type a space between the subtract symbol and the negative sign, and only errors if there is no space between them. Strange.

5--6 → error
5- -6 → ok

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
07-14-2017, 05:52 AM
Post: #3
RE: 5 minus minus 6 on in HOME and CAS
The reason is that you can write j-- to decrement j.
Find all posts by this user
Quote this message in a reply
07-14-2017, 08:58 AM (This post was last modified: 07-14-2017 09:08 AM by webmasterpdx.)
Post: #4
RE: 5 minus minus 6 on in HOME and CAS
How come this isn't documented. A while ago, I was looking for a ++ and -- operator and was trying to create macros (where I discovered that define wasn't a macro generator but a short way to create a program)....but I was doing this to create my own decrement/increment functions....didn't know they already existed....
Also, decrement() and increment() aren't in the catalog.
These are functions that should run in home mode too....however, when I tried to run CAS.decrement(x), it got converted to decrement(5) and didn't decrement x in home mode.....is there a way to get decrement to work in home mode?
Thx
-Donald
Find all posts by this user
Quote this message in a reply
07-14-2017, 12:50 PM
Post: #5
RE: 5 minus minus 6 on in HOME and CAS
(07-14-2017 08:58 AM)webmasterpdx Wrote:  How come this isn't documented. A while ago, I was looking for a ++ and -- operator and was trying to create macros (where I discovered that define wasn't a macro generator but a short way to create a program)....but I was doing this to create my own decrement/increment functions....didn't know they already existed....
Also, decrement() and increment() aren't in the catalog.
These are functions that should run in home mode too....however, when I tried to run CAS.decrement(x), it got converted to decrement(5) and didn't decrement x in home mode.....is there a way to get decrement to work in home mode?
Thx
-Donald

increment and decrement don't work at all for me, even in CAS mode.

a:=8
decrement(a)
gives
decrement(8) then when I display a, I still get 8.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
07-14-2017, 02:09 PM
Post: #6
RE: 5 minus minus 6 on in HOME and CAS
Carefully reread parisse's post: he uses j-- and not decrement(j). The "decrement()" however is what gets displayed in the history.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
07-14-2017, 06:50 PM (This post was last modified: 07-14-2017 06:53 PM by DrD.)
Post: #7
RE: 5 minus minus 6 on in HOME and CAS
or if you want to stick with variable a:

[CAS]
a:=8;
a--; // displays decrrement(a) and a==7
a++; // displays increment(a) and a==8
Find all posts by this user
Quote this message in a reply
07-14-2017, 07:33 PM
Post: #8
RE: 5 minus minus 6 on in HOME and CAS
(07-14-2017 06:50 PM)DrD Wrote:  or if you want to stick with variable a:

[CAS]
a:=8;
a--; // displays decrrement(a) and a==7
a++; // displays increment(a) and a==8

Just so. I wish it worked in Home mode and HPPL programs!
Thanks.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
07-14-2017, 08:48 PM (This post was last modified: 07-14-2017 08:55 PM by DrD.)
Post: #9
RE: 5 minus minus 6 on in HOME and CAS
I suppose you could ask Tim to include it on the new features list, referred to not so long ago.

[HOME]
a:=7;
CAS("a++"); ==> a increments to 8
Find all posts by this user
Quote this message in a reply
07-14-2017, 11:34 PM
Post: #10
RE: 5 minus minus 6 on in HOME and CAS
(07-14-2017 07:33 PM)toml_12953 Wrote:  
(07-14-2017 06:50 PM)DrD Wrote:  or if you want to stick with variable a:

[CAS]
a:=8;
a--; // displays decrrement(a) and a==7
a++; // displays increment(a) and a==8

Just so. I wish it worked in Home mode and HPPL programs!
Thanks.

It DOES work in HP PPL programs, between #cas and #end. It even works with non-CAS variables (e.g. A-- and A++).

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
07-15-2017, 08:29 PM
Post: #11
RE: 5 minus minus 6 on in HOME and CAS
It isn't allowed in home, and we'd have completely removed it from the CAS if possible. This type of construct does not belong in a math focused *calculator*. The problem is, ++ -- is deeply down in the CAS parser and we couldn't remove it.

Try explaining something like --4+++5++ to a student and why it would be valid... (it would be in the HOME parser/evaluation if we enabled increment/decrement type operators)

While in a *programming* language they might make sense, on a calculator that is primarily focused on *math* they do not. Not all languages allow them either because they can introduce confusion, and don't really gain you anything other then a few less characters to type.

They are not documented because we don't want it being used.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
07-16-2017, 09:44 AM
Post: #12
RE: 5 minus minus 6 on in HOME and CAS
I'd rather see some macro type functionality...
Find all posts by this user
Quote this message in a reply
07-16-2017, 11:08 AM
Post: #13
RE: 5 minus minus 6 on in HOME and CAS
(07-16-2017 09:44 AM)webmasterpdx Wrote:  I'd rather see some macro type functionality...

The Prime does have [Shift] [Define], useful for macro functionality. Considering the product purpose of this device, how would you justify anything more (or differently) to, say, a room full of marketing decision makers?

A lot of us know what you are after, many of us would readily buy such a device, but the Prime isn't it. There is a frustration in that the Prime is very close to what is wanted, yet falls short in some respects. That is more a marketing thing, and someday, someone may develop a professional tool. In spite of the fact that it seems so do-able with the Prime, we are still waiting.

Evolving a dream machine might be an interesting thing in which to try to get design consensus. However, a Google scenario, where you attempt to enter an objective, and quickly refine the result, might be a good start. An all knowing, all seeing eye, with mind reading input, is such a simple request, oh yeah, and a government program to mandate that it be freely available in the USA, at least for certain special groups.
Find all posts by this user
Quote this message in a reply
07-17-2017, 08:12 PM
Post: #14
RE: 5 minus minus 6 on in HOME and CAS
define isn't a macro...its just another way to write a one line program...
Find all posts by this user
Quote this message in a reply
07-17-2017, 08:59 PM
Post: #15
RE: 5 minus minus 6 on in HOME and CAS
What, exactly, is your idea of a macro? (Bear in mind, definition of the term, and computer language(s) et al, are not exactly an unheard of concept in this forum).

More precisely, what macro operation are you expecting, within the design objective of the hp Prime? I think the [Define] key actually does meet the definition of macro. Perhaps reassigning keys, (custom keypresses), and the user keyboard feature might do the trick for you, further details in the user guide.

As a tool for educators and students, professional applications are likely to be met with frustration, if you let your expectations take you that far. Basic I/O like RTU, ADC/DAC, data logger, and comm's with the outside world, would be such an enhancement, and seems such a obvious improvement that it would be bound to return any such investment. It is unfortunate that this is outside the scope of the product, and Que sera, sera, to purloin a phrase from Doris Day's day.

-Dale-
Find all posts by this user
Quote this message in a reply
07-18-2017, 05:53 AM
Post: #16
RE: 5 minus minus 6 on in HOME and CAS
I already posted this stuff here....towards the bottom:
http://www.hpmuseum.org/forum/thread-8684.html
Find all posts by this user
Quote this message in a reply
Post Reply 




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