HP Forums
Bugs when using ANS - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Bugs when using ANS (/thread-1664.html)



Bugs when using ANS - slawek39 - 06-19-2014 10:17 AM

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


RE: Bugs when using ANS - Thomas Radtke - 06-19-2014 10:44 AM

(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.


RE: Bugs when using ANS - slawek39 - 06-19-2014 10:52 AM

The "a" should be changed to "5". It works directly on piecewise() funcrion, but not on Ans.


RE: Bugs when using ANS - Joe Horn - 06-20-2014 05:15 PM

(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.


RE: Bugs when using ANS - Helge Gabert - 06-20-2014 06:05 PM

Or, just designate them correctly in the operating system, e.g., Home.Ans, and Cas.Ans.


RE: Bugs when using ANS - slawek39 - 06-24-2014 06:39 PM

If we use subst(Ans,a=5) instead of Ans|a=5 in CAS number 1 problem is solved.