Bugs when using ANS
06-19-2014, 10:17 AM
Post: #1
 slawek39 Member Posts: 74 Joined: Jun 2014
Bugs when using ANS
Software Version 2014 3 31 (6030)

1.| operator used on Ans in CAS return wrong answer.
2. approx(Ans) return wrong answer in Home (not from last element in History)

Attached File(s)
HP Prime 2014 05 31 (6030) Ans.zip (Size: 17.96 KB / Downloads: 20)
Post: #2
 Thomas Radtke Senior Member Posts: 853 Joined: Dec 2013
RE: Bugs when using ANS
(06-19-2014 10:17 AM)slawek39 Wrote:  1.| operator used on Ans in CAS return wrong answer.
What result would be expected if x isn't defined? What am I missing here?

Edit: Ah, sorry, I see it. Variable -a- could be replaced by 5 :-D.
06-19-2014, 10:52 AM
Post: #3
 slawek39 Member Posts: 74 Joined: Jun 2014
RE: Bugs when using ANS
The "a" should be changed to "5". It works directly on piecewise() funcrion, but not on Ans.
06-20-2014, 05:15 PM
Post: #4
 Joe Horn Senior Member Posts: 2,004 Joined: Dec 2013
RE: Bugs when using ANS
(06-19-2014 10:17 AM)slawek39 Wrote:  2. approx(Ans) return wrong answer in Home (not from last element in History)

Yes, this is unexpected (and IMHO very annoying) but it's not really a bug. Here's why. There are two totally independent system variables which are both called Ans: one in Home, and one in CAS. All CAS functions (even when called from Home) use the CAS Ans. Since approx() is a CAS function, approx(Ans) will always use CAS's Ans (which is always whatever is at the bottom of the history stack in CAS), not Home's Ans (which is NOT always whatever is at the bottom of Home's history stack).

Try this:
CAS: 1+2 Enter --> 3
CAS: Ans Enter --> 3 (as expected)
Home: 5+6 Enter --> 11 (as expected)
Home: Ans Enter --> 11 (as expected)
Home: approx(Ans) --> 3 (yikes!!! it used CAS's Ans!)
Home: Ans --> 3 (Home's Ans got changed by the previous command!)

Solution: Use EVAL (Shift comma), not approx (Shift Enter) in Home when you want to evaluate Ans (or anything else):

CAS: 1+2 Enter --> 3
CAS: Ans Enter --> 3 (as expected)
Home: 5+6 Enter --> 11 (as expected)
Home: Ans Enter --> 11 (as expected)
Home: EVAL(Ans) --> 11 (ahh)

Personal opinion: Having two different values for Ans is a misfeature, since it makes Ans almost useless, since, to use Ans correctly, you have to memorize which functions are CAS functions and which are not. I hope that a future firmware update resolves this by having only one Ans, which is shared by both Home and CAS.

<0|ΙΈ|0>
-Joe-
06-20-2014, 06:05 PM
Post: #5
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
RE: Bugs when using ANS
Or, just designate them correctly in the operating system, e.g., Home.Ans, and Cas.Ans.
06-24-2014, 06:39 PM
Post: #6
 slawek39 Member Posts: 74 Joined: Jun 2014
RE: Bugs when using ANS
If we use subst(Ans,a=5) instead of Ans|a=5 in CAS number 1 problem is solved.
 « Next Oldest | Next Newest »

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