[comp.sys.handhelds] Howzabout _proper_ fractions on the HP 48sx?

funkstr@ucscb.ucsc.edu (Larry Hastings) (12/30/90)

Now that I have this neat new HP 48sx, I've been exploring all the wild and
wonderous things it can do.  One which I noted was that it will turn any
number into a best-approximation fraction (or just about) using the ->Q
command.  However, if the original number was greater than 1 (or less than -1)
the fraction it generates is _always_ improper.  This is slightly annoying,
as my $25 calculator will do this just fine.  (Well, if the number was
originally entered as a fraction... but _still_.)

This looks to be a "simple matter of programming", but the fact is this is
my first exposure to HP handheld computing, and I know nothing about
programming it.  I _was_ going to make it my learning experience at programming
the HP 48sx, but now realize that I'm in over my head.  Would anyone out there
care to take a crack at writing this for me?  (And, if possible, commenting
it so I can understand what you did?)

Also, could someone explain:
	1) what ->ASC is and why I need it (I do a lot of up/downloading
	   to/from my HP 48sx and haven't needed it yet, it seems)
	2) how to conveniently use the "UP" command that someone wrote (the
	   one that lets you go "up" the built-in menus) -- typing in
	   "alpha-U-P-enter" is cumbersome, and putting it on the user keyboard
	   is more keystrokes ("leftshift-alpha-KEY-leftshift-alpha"), and
	   putting it on the CST menu would defeat the purpose
--
larry hastings, the galactic funkster, funkstr@ucscb.ucsc.edu

I don't speak for Knowledge Dynamics or UC Santa Cruz, nor do they speak for me

"Roar, I say, ROAR!" --Foghorn Leghorn (as a fire-breathing dragon), Tiny Toons

funkstr@ucscb.UCSC.EDU (Larry Hastings) (12/30/90)

+-In article <10469@darkstar.ucsc.edu>, I wrote (asked):
|
| [ The HP 48sx will convert any ]
| number into a best-approximation fraction (or just about) using the ->Q
| command.  However, if the original number was greater than 1 (or less than -1)
| the fraction it generates is _always_ improper.
| [ Could someone write an HP 48sx program to generate proper fractions? ]
+----------

I'd been hesitating posting this for a week, and I finally went and posted
it -- and mere hours later, I figure out the answer all on my own.

In case you're wondering, this is it:
<< DUP IP SWAP FP ->Q + >>

(The trick being that a "algebraic object" 'foo' plus a number X comes out
as 'foo+X' -- and if you reverse X and 'foo' on the stack, you get 'X+foo'.)

However, I'd still appreciate an answer to my other two questions:

+----------
| 	1) what ->ASC is and why I need it (I do a lot of up/downloading
| 	   to/from my HP 48sx and haven't needed it yet, it seems)
| 	2) how to conveniently use the "UP" command that someone wrote (the
| 	   one that lets you go "up" the built-in menus)
+----------

(On #2, I've been thinking that I may just put it someplace convenient on
the "user mode" layout, and just never leave user mode... after all, I never
use SIN, COS, or TAN... but that may just be too silly.)

--
larry hastings, the galactic funkster, funkstr@ucscb.ucsc.edu

I don't speak for Knowledge Dynamics or UC Santa Cruz, nor do they speak for me

"Roar, I say, ROAR!" --Foghorn Leghorn (as a fire-breathing dragon), Tiny Toons

bill@videovax.tv.tek.com (William K. McFadden) (01/01/91)

In article <10472@darkstar.ucsc.edu> funkstr@ucscb.UCSC.EDU (Larry Hastings) writes:
->| 	2) how to conveniently use the "UP" command that someone wrote (the
->| 	   one that lets you go "up" the built-in menus)
->
->(On #2, I've been thinking that I may just put it someplace convenient on
->the "user mode" layout, and just never leave user mode... after all, I never
->use SIN, COS, or TAN... but that may just be too silly.)

Why don't you just redefine the UP key that's already on the
keyboard?  That's what I did.  Remember to leave USER mode on.
-- 
Bill McFadden    Tektronix, Inc.  P.O. Box 500  MS 58-639  Beaverton, OR  97077
bill@videovax.tv.tek.com,     {hplabs,uw-beaver,decvax}!tektronix!videovax!bill
Phone: (503) 627-6920       "The biggest difference between developing a missle
component and a toy is the 'cost constraint.'" -- John Anderson, Engineer, TI