Struggling with CAS programming
|
09-18-2018, 01:48 AM
Post: #11
|
|||
|
|||
RE: Struggling with CAS programming
(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 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)