Post Reply 
Struggling with CAS programming
09-18-2018, 02:40 AM
Post: #13
RE: Struggling with CAS programming
(09-18-2018 01:48 AM)Steve Simpkin Wrote:  
(09-17-2018 01:49 PM)rushfan Wrote:  The Prime seems to be a very powerful tool, but there is still a lot very frustrating and unnecessary friction working between the CAS and Home, and writing programs. I still don't see why the Home exists, when the CAS is perfectly capable of making numeric calculations, and the existence of the Home places a lot of friction and restrictions.

A little background on why there is a Home and CAS environment (mode) and when to use one or the other:

-----------------------------------------------------------------------------
Re: HP Prime: Proper Use of Home View and CAS View
Message #4 Posted by Joe Horn on 4 Dec 2013, 8:52 p.m.,
I'm not a design team member, or even an HP employee, but I think I understand the concept behind Home versus CAS.
HP Prime Home is like Approx mode on the HP 50g.
HP Prime CAS is like Exact mode on the HP 50g.

For those without 50g experience:
Home is primarily for approximate numeric calculations.
CAS is primarily for exact symbolic operations.

Simple example: A student is asked, "What is the square root of 12?" Should the student answer "Approximately 3.46410161514", or "Exactly 2 times the square root of 3"? Both answers are correct, and both are needed in different circumstances. That's why Prime offers both environments.

Another simple example: What is 2^1234? Home says it's approximately 2.958 times 10^371. That's plenty good enough for most real-world purposes. But if you ever need every digit of the exact answer (e.g. for Number Theory work), CAS returns all 372 digits of 2^1234. Whichever you need, Prime offers both.

I hope that this distinction clarifies why both modes exist, and why SIN(pi) (in radian mode) gets different results in Home and CAS.

Even 0.5-0.4-0.1 gets different results in Home and CAS. And it's not a bug. Nor is it a surprise to anyone who understands the difference in purpose and implementation of Home and CAS. It's only a surprise (and an annoyance) to those who expect Home and CAS to work the same. (If they worked the same, there would be no need for both to exist).
-Joe-

-----------------------------------------------------------------------------
Re: HP Prime: Proper Use of Home View and CAS View
Message #9 Posted by cyrille de Brébisson on 5 Dec 2013, 7:45 a.m.,

Hello,
Joe's answer is great for when to use CAS and when to use home. A short summary would be: - If you are expecting a NUMERICAL answer, go to home (1/3 -> 0.3333...) - If you are Using the VALUES of variables, go to home - If you are expecting a symbolic answer, go to CAS (sqrt(12) -> 2*sqrt(3) - If you are using variables as variables, go to CAS

as for RANDOM, as it turns out, the CAS syntax for RANDOM is weired, it's RANDOM or RANDOM value; (with no ()!) so, RANDOM (1,5); is RANDOM of a value. This value match the short syntax for complex numbers, hence the strange output!
Cyrille

Most of this I think misses the point. It seems that what most people want is a CAS with pretty typing. That is what I want too and why frequently the HP Prime feels annoying to use. I don't want to see all the 372 digits of 2^1234. Is anyone doing number theory on a pocket calculator?

Is there any way to change the precision and the formatting of results in the CAS?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Struggling with CAS programming - rushfan - 09-17-2018, 12:54 AM
RE: Struggling with CAS programming - rushfan - 09-18-2018 02:40 AM



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