Post Reply 
Bug? Odd behavior of [a b/c] with results from mean().
11-28-2015, 02:14 PM (This post was last modified: 11-28-2015 02:22 PM by Joe Horn.)
Post: #6
RE: Bug? Odd behavior of [a b/c] with results from mean().
(11-26-2015 03:33 PM)Michael K-K Wrote:  When calculating the mean of a list and you would expect a floating point number, the prime gives a fraction which can't be converted to decimal with the [a b/c]-button.

Not a bug. mean() is a CAS function designed to return exact symbolic results, e.g. mean({x,y,z,t}) returns '(x+y+z+t)/4' in CAS. If you want to call it from Home and have it always return approximate floating point results, go to CAS Setup and uncheck the "Change apparent integers into exact integers" option (1st page, 3rd line, right end). To have the same effect in CAS, uncheck the "Exact" option in CAS Settings (5th line). These settings control whether or not CAS functions return exact results or floating-point results in Home and CAS respectively. It's nice to be able to change this behavior as needed.

Also, please note that the fraction key [a b/c] in Home does not change actual symbolic fractions (like '2/3', note the single quotes) into reals. Try it; in Home, type '2/3', press Enter then [a b/c] and see that it doesn't do anything. Or calculate exact(1.5) in Home and try pressing [a b/c] on the result. On the other hand, when you type 1.5 in Home, press Enter, and then press [a b/c], that's not REALLY a symbolic fraction you see; it's merely a helpful but fictional display mode, sorta like FIX 2. The real floating-point number (at full accuracy) is still there on the history stack, hidden behind the fictional fraction that's being displayed. This is radically different from the behavior of the [a b/c] key in CAS, where it is simply a shortcut for calling the exact() or approx() functions.

(11-26-2015 03:33 PM)Michael K-K Wrote:  The really funny thing is, this works fine with median().

That's because median() never returns a fraction. When given an even number of items, it returns the one before the middle, not the average of the middle two items.

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Bug? Odd behavior of [a b/c] with results from mean(). - Joe Horn - 11-28-2015 02:14 PM

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