Path: seq!spell
From: Lutz Vieweg <lv@muffel.hotb.sub.org>
Subject:  v01i038:  xunit - The inverse to UBASE v1.0, Part01/01
Newsgroups: comp.sources.hp48
Followup-To: comp.sys.hp48
Approved: spell@seq.uncwil.edu

Checksum: 4077776933 (verify with brik -cv)
Submitted-by: Lutz Vieweg <lv@muffel.hotb.sub.org>
Posting-number: Volume 1, Issue 38
Archive-name: xunit/part01

XUNIT - the reverse UBASE for the HP48sx
             written by Lutz Vieweg 1991

When HP implemented the unit-calculation routines in their 48sx,
they forgot a very often requestet function - the inverse function
to UBASE. 

If you calculate with units, you will face a monsterous term after
a while, because the 48sx does not "shorten" the unit-fractions.

This program fills the gap. You may type e.g.

Your input               Result
----------------------------------------------------
2.34_F/V             1:                   2.34_nF/mV
UBASE                1: .00000234_A^3*s^7/(kg^2*m^4)
XUNIT                1:                .00000234_F/V

I hope you can see the meaning of XUNIT.

Below is a ->ASC encoded directory, which consists of the following:

XUNIT      The main program. Uses XU.L, XU.A, U->A and ARRSUM

XU.L       Is a list of your favourite units. Edit this list, if
            you want to, then call XL->A to create XU.A out of the
            list. XUNIT will only try to use the units in this list.

XL->A      Creates the XU.A list from the XU.L list. This has to be
            done any time you change XU.L

U->A       A subroutine that creates an array from an unit-object
            representing the exponents of the basic units.
           NOTICE: This one uses self-modifying ML. Do not store
                   this one into protected RAM or libraries.

ARRSUM     Simply does ABS with any member of an array.

XU.A       is used by XUNIT for internal use.


This PGM is public domain. I would like to see any improvements,
especcially speed-ups.

cu, Lutz Vieweg.


-- 
      *** EMail to:  lv@muffel.hotb.sub.org   ***
      *** FidoNet :  2:247/30.20              ***

