UnitCalc & MacUnitCalc
A calculator that keeps track of units
Most arithmetic problems, both in classes and in the real world, involve
calculations using quantities with units -- feet, meters, volts, ohms,
siemens, etc. Yet a conventional calculator only helps you with the
numbers; you have to keep track of the units yourself.
Not so with UnitCalc. It's a Reverse Polish Notation
calculator which does all arithmetic with the numbers and the
units. Many mistakes will be caught immediately when the units in your
answer are not what you expect; other mistakes will be avoided entirely,
since you never need to shift decimal places (for example, when dividing
m^2 by mm*cm). Moreover, UnitCalc is fully configurable -- you define
what units you like to use. It will even do American units, if that's
what you prefer.
Two versions of the software are available. MacUnitCalc
is a Macintosh-only version, with a nice graphical interface.
UnitCalc is written in mostly-ANSI-compliant C++, and uses a
console-based interface for maximum portability. A compiled app for the
Mac is readily available; Unix users should be able to compile it just
fine with g++. It will probably also run under DOS or Windows with a
|You Enter:||UnitCalc Displays:||What's Going On?
||per our preferences, show mass in kilograms
|puts 5 square meters on the stack
||1.5 m^2 kg
||multiplies top 2 elements of stack, with units
||empties the stack
||puts 1 joule on the stack
|puts 1 watt on the stack
||1000 m^2 sec^-3 g
1000 m^2 sec^-2 g
|turns off unit conversion;
shows values in base units
||divides (1 j / 1 w), leaving 1 sec on stack
||10000 m^2 sec^-2 g c^-1
||puts 10 volts on the stack in base units
||resume showing in preferred units
|puts 2 ohm on the stack
||divide (an application of Ohm's Law)
You can download UnitCalc via the web,
free of charge.
Currently, all I have is a reference
manual. But with that, and the examples above, you'll probably
have no trouble figuring it out.
UnitCalc is currently at version
0.5, and MacUnitCalc is version
. If you want any improvements, or have bugs to report,
please write to me.
Dave Lyons has created
a similar command-line calculator available as C source code. He also
provides handy data files defining a huge variety of units.
. . . . . . firstname.lastname@example.org