UnitCalc & MacUnitCalc

A calculator that keeps track of units


Introduction

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.


System Requirements

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 little tweaking.

Some Examples

You Enter:UnitCalc Displays:What's Going On?
300 g 0.3 kg per our preferences, show mass in kilograms
5 m^2 5 m^2
0.3 kg
puts 5 square meters on the stack
* 1.5 m^2 kg multiplies top 2 elements of stack, with units
clear empties the stack
j 1 j puts 1 joule on the stack
w 1 w
1 j
puts 1 watt on the stack
off 1000 m^2 sec^-3 g
1000 m^2 sec^-2 g
turns off unit conversion;
shows values in base units
/ 1 sec divides (1 j / 1 w), leaving 1 sec on stack
10 v 10000 m^2 sec^-2 g c^-1 puts 10 volts on the stack in base units
on 10 v resume showing in preferred units
2 ohm 2 ohm
10 v
puts 2 ohm on the stack
/ 5 amp divide (an application of Ohm's Law)

Get UnitCalc

You can download UnitCalc via the web, free of charge.

Documentation

Currently, all I have is a reference manual. But with that, and the examples above, you'll probably have no trouble figuring it out.

Version Info

UnitCalc is currently at version 0.5, and MacUnitCalc is version 1.0b . If you want any improvements, or have bugs to report, please write to me.

See Also...

Dave Lyons has created DimCalc, a similar command-line calculator available as C source code. He also provides handy data files defining a huge variety of units.


http://www.strout.net/macsoft/unitcalc/index.html
Last Updated: 3/30/98 . . . . . . webmaster@strout.net