[comp.sys.handhelds] Dissecting unit objects on the HP48sx

austern@ux5.lbl.gov (Matt Austern) (07/31/90)

I've written a generalization of CONVERT to handle the unit systems
that conventionally get used in high energy physics.  (It's common to
set hbar=c=1, so that, for example, 1 GeV might be a unit of energy,
mass, frequency, or inverse length, depending on the context.  It
probably sounds goofy to you, but it really is convenient.)

The trouble is that at one point, I need to know how many powers of
each base unit are in some unit object.  My current method works, but
it is quite disgusting: I use UBASE, convert the result to a string,
and then scan that string to find the exponents.

Would anybody like to suggest a better way to do this?  I couldn't
think of anything better using documented functions, but maybe there's
a way to do it using the internal representation of unit objects?  Or
maybe I just missed something obvious.
-- 
Matthew Austern    austern@lbl.bitnet     It's not very subtle, but, uh, 
(415) 644-2618     austern@ux5.lbl.gov    neither is blowing up a whole school.