[comp.sys.handhelds] HP 48sx 'Q' weirdness

pete%slack.uucp@cs.utah.edu (Pete Ashdown) (03/14/90)

Try this gnifty (and puzzling) trick.  Throw 60 degrees on the stack.  Do this
by entering 60 and then going to UNITS/ANGLES and hitting the degree sign.  Now
convert it to radians by hitting (Left/Orange) shift R.  You should have the
radians on the stack now.  It is displayed as 1.0471975512_r.  So this is
theoretically the same as '1/3*pi' right?  Wrong.  Hit (Right/Blue) shift UNITS
and get the value by hitting UVAL.  Hit enter so you have an extra copy of the
value in level 2.  Now go into ALGEBRA and then NXT to the ->Q(pi) (Kewpie??)
function.  Hit ->Q(pi) and see what the value really comes out as.  It should
be '382136/364913'.  This is because it divides out pi and if the value of the
->Q result's denominator is lower than the ->Q(pi)'s result, it will choose the
->Q result.  In short, what you have is the ->Q result.  Now drop that off the
stack and divide pi out of the value yourself and hit ->Q.  You will find that
the fraction is very close to 1/3, but it isn't actually 1/3.  Its
((1*10^10)+1))/((3*10^10)+2).  What's the deal?  Is there any way to adjust
the precisions of the ->Q functions?  I enjoyed the fraction programs that were
written for the 28 a lot, especially being able to divide out pi and coming up
with a small fraction (works great for Calculus surface/volume problems).  The
precision factor of these programs were essential though!  How do I do it on
the 48?

Another small, cute, story.  I had a Calculus final today.  I didn't bother to
study any of the conic sections stuff because 'my calculator can now grunge
that stuff'.  Well, I came across a problem that was of the 'draw the
hyperbola' type.  I entered the equation, shifted to polar, changed the plot
type to polar and did the DRAW.  BAM! A few seconds later it came back to tell
me that it couldn't handle it because of a '^ unknown variable' error.  I
grimaced in anger and went on with the miserable test.  What's the deal here?
Does the 48sx only plot polar equations when it likes to?  I was doing all
kinds of types before the test with no problems whatsoever.  I don't think that
the problem was extraordinary (no, I don't have the equation here) either.

"People should be beat up for stating their beliefs."  - They Might Be Giants
This is to certify and promulgate American Family Publisher's intent to award
 TWENTY MILLION DOLLARS to PETE ASHDOWN!  Yippee!  UseNet is on me everyone!
[pete@slack.uucp]       [...utah-cs!i-core!slack!pete]        [slack=AMIGA!!]

rodmur@csuchico.edu (Dale Andrew Harris) (03/14/90)

In article <1990Mar13.140026.409@hellgate.utah.edu> pete%slack.uucp@cs.utah.edu (Pete Ashdown) writes:
>
>Another small, cute, story.  I had a Calculus final today.  I didn't bother to
>study any of the conic sections stuff because 'my calculator can now grunge
>that stuff'.  Well, I came across a problem that was of the 'draw the
>hyperbola' type.  I entered the equation, shifted to polar, changed the plot
>type to polar and did the DRAW.  BAM! A few seconds later it came back to tell
>me that it couldn't handle it because of a '^ unknown variable' error.  I

Too bad.  I'd say always study, never know what might go wrong.  Besides 
someday you may have to use that experiance with conics, especially if
you're majoring in any technical or scientific field.

														Dale A. Harris
														INTERNET: rodmur@csuchico.edu

What can of batteries does the Earth take??

madler@tybalt.caltech.edu (Mark Adler) (03/15/90)

->Q and ->Q(pi) both have their precision controlled by the display format.
It's an inconvenient way to do it, but at least you can.  (They fixed this
with RND from the 28 to the 48, but must have not thought it was a good idea
for ->Q.)  For example, a 10 FIX or a 10 SCI followed by (pi) 3 / ->Q(pi)
gives '1/3*(pi)', like it ought to.  Also a 6 FIX (pi) ->Q gives my favorite
rational approximation to pi: '355/113' (which you can get by writing
113355 and cutting it in the middle).

I still don't understand the behavior of ->Q(pi) though.  It ought to give
you a rational times pi, whether it can find a "good" rational or not.

Mark Adler
madler@hamlet.caltech.edu

billw@hpcvra.CV.HP.COM (William C Wickes) (03/16/90)

The precision of ->Q is controlled by the current floating-point display
format.  See p. 136 in the manual.

I can't tell what your plotting problem is from your description, but
it sounds like you have selected POLAR plot type, when you are trying
to plot a conic section.  The latter is a quadratic in two variables, so
one or the other may be undefined when polar plotting.  In CONIC type
plots, the system supplies values for both variables.