[comp.sys.handhelds] Update on using UBASE

dan@Apple.COM (Dan Allen) (03/19/90)

I mentioned earlier about a bug/feature of UBASE rounding all unit
powers to the nearest integer.  It turns out that in the case that I had
encountered, I have found an excellent solution to the problem so that
this never occurs.

BACKGROUND: I am working with various powers of the physical constants
h,c,G,e,etc, and combining them to do conversions between different
units.  (This sort of thing is done in general relativity physics, for
example.)  I had these constants as variables containing algebraic
expressions or just numbers, with their associated HP-48SX unit objects.
After combining many of the constants to various powers and taking roots
and the like, I would use UBASE to return things to the fundamental SI
units, because some of the constants were defined in terms of Joules or
Newtons or whatever.

SOLUTION: By simply defining these constants in their most basic units
(meters, seconds, kilograms) instead of in Joules or Newtons, arithmetic
handles fractional exponents without any problem.  The solution in this
case, therefore, is to simply not need to use UBASE at all by having the
calculation automatically proceed in fundamental units.

So the integer-only aspect of UBASE turns out to be sidestepped by not
requiring the use of UBASE for my rather specialized use of HP-48SX
units, which, by the way, are wonderful.  I have never been able to play
with the physical constants in any other package (including Mathematica
and Maple) as easily and nicely as on the HP-48SX.  What a wonderful
machine...

Dan Allen
Apple Computer