Post Reply 
Bugs when using ANS
06-19-2014, 10:17 AM
Post: #1
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)

I added attachement with screens


Attached File(s)
.zip  HP Prime 2014 05 31 (6030) Ans.zip (Size: 17.96 KB / Downloads: 20)
Find all posts by this user
Quote this message in a reply
06-19-2014, 10:44 AM (This post was last modified: 06-19-2014 10:49 AM by Thomas Radtke.)
Post: #2
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.
Find all posts by this user
Quote this message in a reply
06-19-2014, 10:52 AM
Post: #3
RE: Bugs when using ANS
The "a" should be changed to "5". It works directly on piecewise() funcrion, but not on Ans.
Find all posts by this user
Quote this message in a reply
06-20-2014, 05:15 PM
Post: #4
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-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-20-2014, 06:05 PM
Post: #5
RE: Bugs when using ANS
Or, just designate them correctly in the operating system, e.g., Home.Ans, and Cas.Ans.
Find all posts by this user
Quote this message in a reply
06-24-2014, 06:39 PM
Post: #6
RE: Bugs when using ANS
If we use subst(Ans,a=5) instead of Ans|a=5 in CAS number 1 problem is solved.
Find all posts by this user
Quote this message in a reply
Post Reply 




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