# Unc User's Guide

### Unc: A Units Calculator

Document revision D6 for Unc 1.6
For the latest version of this document, see www.greenwoodsoftware.com/unc/unc.html.

# Overview

## What is Unc?

Unc is a calculator which runs on the 3Com PalmPilot and on Microsoft Windows. Unc is actually two calculators in one: a scientific calculator that allows arbitrary arithmetic on numbers containing UNITS, and a full featured programmer's calculator that supports word sizes up to 128 bits.

## What does Unc do?

Here are some other things that Unc can do:

### Floating point operations

Arithmetic
Addition, subtraction, multiplication, division, reciprocals, powers and roots.
Logarithms
Natural and common logarithms, and exponentials.
Trigonometric functions
Sine, cosine, tangent, and their inverse functions. Operates on either degrees or radians.
Hyperbolic functions
Hyperbolic sine, cosine, tangent, and their inverse functions.
Display modes
Numbers can be displayed in standard, fixed-point, scientific or engineering notation. Numbers can be scrolled if they are too long to fit on the display.
Units
All operations (where applicable) can be applied to numbers with units. Numbers can be converted between different units.

### Integer operation

Base
Binary, octal, decimal, hex, or any other base from 2 to 36.
Large word size
Word size up to 128 bits.
2-s complement
Operates in either unsigned mode or signed 2-s complement mode.
Logical operations
And, or, exclusive-or, not.
Logical and arithmetic shifts, rotates, masks and byte-swap.

### General

Stack
User-settable stack size.
Memory
Ten memory locations, separate from the stack.
Number format
Numbers can be displayed with or without spacing characters, or with user-adjustable spacing characters.

## What do I need to use Unc?

To run the PalmPilot version of Unc, you need a 3Com PalmPilot version 2.0 or later (PalmPilot Personal, PalmPilot Professional, Palm III, Palm V, or Palm VII). You'll also need a PC or Macintosh computer with Palm Desktop or similar software to install Unc onto your PalmPilot.

To run the Windows version of Unc, you need Windows 95 or later (Windows 95, Windows 98, Windows NT 4.1, Windows 2000, Windows ME, Windows XP).

# Getting started

## Installing Unc

### PalmPilot version

To install the PalmPilot version of Unc, you must load three files onto your PalmPilot:

unc.prc
This is the Unc program file.
uncDB.pdb
This is the database containing all the unit defintions.
MathLib.prc
This is the shared library containing math functions.

There are two versions of the database; uncDB.pdb contains unit definitions which are standard in the United States, and uncDB-UK.pdb contains unit definitions which are standard in the United Kingdom. If you wish to use the UK version, load uncDB-UK.pdb instead of uncDB.pdb. It is not strictly necessary to load either .pdb file; Unc will operate correctly without them, but you won't have any predefined units, and you will have to define all the units yourself.

Mathlib is a free shared library that can be used by any OS 2.0+ PalmPilot program that needs IEEE 754 double precision math functions. It is distributed under the terms of the GNU Library General Public License, and is freely available with full source code and documentation at www.probe.net/~rhuebner/mathlib.html. It is not a part of the Unc program, and you're not paying anything for its use; a copy is included with Unc for your convenience. If you already have a copy of Mathlib on your PalmPilot, it is not necessary to load it again.

### Windows version

To install the Windows version of Unc, run the unc16.exe program and follow the on-screen instructions. The first time you run Unc, you will be asked to select one of the two units files to import. Select units-US.txt if you want to use the unit definitions which are standard in the United States, or select units-UK.txt if you want to use the unit definitions which are standard in the United Kingdom.

## Introduction to Unc

When you first start the Unc calculator, it will look like this:

### Standard float buttons

(Note: all screen shots are from the PalmPilot version, but the Windows version looks very similar.) The alt button on the bottom left is special. When you press it, many of the buttons change to an alternate form. This gives access to more functions than would fit on the existing buttons. When you press alt, here's what you'll see:

### Alternate float buttons

Notice that the alt button has changed to ALT to signal that you're seeing the alternate buttons. Many of the buttons now have different labels. You can press ALT again to return to the standard buttons.

The top row consists of unit buttons. The rightmost five buttons are the most common units (you can change these if you find you use other units more often). When you press the unit button at the top left, most of the buttons on the calculator will change to show you more units, 25 of them. When you do this, here's what you'll see:

### Standard unit buttons

Now 25 buttons, all except the left column and the bottom two rows, have changed to units. (Some of them are blank to leave some buttons for you to assign your own favorite units.) The 8 buttons at the right of the two bottom rows are metric prefixes. The unit button has changed to UNIT to signal that you are in unit mode. You can press the UNIT button again to return to the standard buttons. You can change the 25 unit buttons to have different units if you wish. See the sections on entering units and assigning units to buttons for more information.

The 25 units you see in unit mode are called the standard units. Pressing alt while you are in unit mode shows you an additional 25 units, called the alternate units. Here are the alternate units you'll see:

### Alternate unit buttons

There's one other important way the calculator can change its behavior. Notice the .10 in the upper center of the display. This is the base indicator. The dot is telling you that you are in float mode, and the 10 is telling you what the current precision is. If you press the base indicator, you can change the base from float to an integer base. If you do so, changing to hexadecimal (base 16) for example, here's what you'll see:

### Standard integer buttons

Notice that the base indicator has changed to hex and most of the buttons have changed again.

And of course, pressing alt while in integer mode gives you some more buttons:

### Alternate integer buttons

You can refer to these pictures if you are trying to find a button and it doesn't appear on the buttons you are currently viewing.

To summarize, there are three basic modes which the buttons can be in:

 Float When the base is "float". Unit When you press the unit button while the base is "float". Integer When the base is an integer (hex, etc).

In each of these modes, the buttons are also changed by pressing the alt button.

# User's manual

## Using an RPN calculator

Unc is a Reverse Polish Notation or RPN calculator. If you're not familiar with RPN, it will take a little time to get used to, but you'll probably find it easier to use than standard algebraic calculators once you've adjusted to it.

In an RPN calculator, when you enter a number, you are placing (or "pushing") the number onto the stack. The stack is just a list of numbers. Unc always shows you the top four numbers on the stack. If there are more than four numbers on the stack you can scroll the display to see the others. When you do an operation, like pressing the + button, you are operating on the top number or top two numbers on the stack. For example, the + button adds together the top two numbers on the stack and replaces them with the result.

For example, suppose you want to add 15 and 7. First you press 1, then 5. Notice the underscore after the last digit you entered, which shows where the next digit will appear. Then you press the ENT button, to say you're done with that number. This pushes the number 15 onto the stack. The underscore disappears, to show that you are no longer entering a number, but instead are looking at the top number on the stack. Next you press 7. Then you can press ENT again to push 7 onto the stack. Now the stack has two numbers, 15 and 7. Then you press +, which adds the two numbers and replaces them with the result, 22. Now the stack has one number, 22.

In this example, it wasn't really necessary to press ENT after the 7. If you press an operation button like + while you're entering a number, Unc automatically pushes the number on the stack before doing the operation.

Whatever number you entered most recently is called the "top" of the stack. Each time you enter a number, any numbers already on the stack get "pushed down" and the new number becomes the top of the stack. The Unc display always shows the top number on the stack in the main display window, and the next three numbers on the three lines above it. Don't get confused by the fact that the top of the stack is actually at the bottom of the display. Once you start using the calculator, it will be obvious how it works.

## Entering numbers

To enter a number, just start pressing digit buttons. You can press the +/- button to change the sign of the number you're entering.

In float mode, you can press the DOT button to enter a decimal point. You can press EEX to enter the exponent of 10 in scientific notation. For example, pressing "4 5 3 . 7 EEX 6" enters "453.7 e6", which is 453.7 million. After you press EEX, then the +/- button changes the sign of the exponent instead of the sign of the entire number.

In integer mode, the DOT and EEX buttons are not available. Also, only the digits which are valid in the current base are active. For example, in octal (base 8), only the digits from 0 through 7 are active.

Another way to enter digits in the PalmPilot version is by writing the Graffitti glyph for the number. In float mode, you can enter the decimal point this way, and the EEX button (by writing an "e"). In integer mode, if the base is greater than 10, you can enter the higher digits (for example, A through F in hexadecimal) by writing the Graffitti glyph for the letter. For bases larger than 16, this is the only way to enter some of the digits, because there are no buttons for digits larger than F.

Similarly, in the Windows version you can just press the appropriate keys on the keyboard to enter the digits and the decimal point.

If you make a mistake while entering a number, press BSP to erase digits and reenter them, or enter the Graffitti backspace glyph. If you are not entering a number, pressing BSP deletes the top number from the stack.

If the number you are entering becomes too long to fit on the display, it will scroll off the left edge of the display. When that happens, a scroll arrow will appear to the left of the display, and a small number shows how many characters are scrolled off to the left. Pressing the scroll arrow will shift the display, which may cause another scroll arrow to appear at the right of the display. You can scroll the number back and forth to view it.

When you are finished entering a number, you can immediately operate on it by pressing one of the operation buttons, or you can push it onto the stack by pressing ENT.

## Using the stack

The top four numbers on the stack are displayed on the screen. If there are more than four numbers on the stack, scroll arrows appear, which you can use to scroll the stack up and down. This merely changes what part of the stack you are looking at; it does not change the stack itself. You can also use the PalmPilot's up and down buttons (the physical buttons on the case) to scroll the stack. On the PalmPilot, if you tap a number on the stack, it changes places with the top number on the stack. This is an easy way to bring a number which you wish to use to the top of the stack. On Windows, double-clicking a number on the stack does the same thing.

The up and dn buttons "roll" the stack. Unlike scrolling, this does change the stack itself. Pressing the up button moves the bottom number on the stack to the top of the stack. Pressing the dn button moves the top number on the stack to the bottom of the stack.

## Using memory

If you press the mem button, the display changes to a list of ten memory locations. Each memory location can hold one number. To store a number into a memory location, select a memory location and press the Store button. This copies the top number on the stack to the selected memory location. The number is also removed from the top of the stack. Then later, to recall a number from a memory location, select the memory location and press the Recall button. This copies the number from the selected memory location to the top of the stack. The number is not removed from the memory location, so it can be used again later.

There are three ways to select a different memory location: just tap it with the pen (or click it in the Windows version), or use the up and down buttons to move the selection, or write a Graffitti glyph for a number between 0 and 9 (press the appropriate digit key in the Windows version). Once you have selected a memory location, it will still be selected if you leave the Memory screen and return to it later.

## Doing arithmetic

To perform an arithmetic operation, you simply press one of the buttons that represents an arithmetic operation. Some of the operations, like + and *, operate on the top two numbers on the stack, and replace them with the result of the operation. Other operations, like sqrt and sin, operate on just the top number on the stack, and replace it with the result.

You can also enter Graffitti glyphs (or press keyboard keys in the Windows version) for some of the more common arithmetic operations. Writing a "+" is equivalent to pressing the + button, which adds the two numbers on top of the stack. Similarly, "-" is equivalent to the - button (subtract); "*" is equivalent to the * button (multiply); and "/" is equivalent to the / button (divide).

## Changing how numbers are displayed

In float mode, numbers are displayed in one of two formats.

Ordinary format
The number is displayed as digits, possibly followed by a decimal point and more digits.
Scientific notation
The number is displayed as an ordinary number, followed by "e" and an integer. This is interpreted as the number times 10 to the power of the integer after the "e". For example, "8 e6" means 8,000,000 and "9.47 e6" means 9,470,000. The number before the "e" is called the mantissa and the number after the "e" is called the exponent.

### Display mode

In float mode, there are four display modes, which affect how numbers are displayed. You can change the display mode using the Display menu item.

Standard
In standard display mode, numbers are usually displayed in ordinary form, rather than in scientific notation. Any trailing zeros to the right of the decimal point are not shown. If a number is too long to be displayed in this way, it is displayed in scientific notation.
Fixed
Fixed display mode is like standard, except trailing zeros are not suppressed, so there are always N digits to the right of the decimal point, where N is the current precision. However, as in standard display mode, if a number is too long to be displayed in this way, it is displayed in scientific notation.
Scientific
In scientific display mode, numbers are always displayed in scientific notation. The mantissa will be between 1 and 10 (unless the number is zero).
Engineering
In engineering display mode, numbers are displayed in scientific notation. The mantissa will be between 1 and 1000, and the exponent will be a multiple of three.

In any display mode, if the number is too long to be displayed at all, it is truncated and an ellipsis (...) is appended to the number. This can only happen if the number has units. You can press full to see the truncated portion of the number.

### Precision

In float mode, the precision specifies the maximum number of digits to be displayed to the right of the decimal point. The actual number of digits displayed may be less than this, depending on the display mode. This only affects the display of numbers after they are on the stack; it does not prevent you from entering as many digits as you wish when you are typing in a number. The precision affects numbers in ordinary format only, not in scientific notation. The current precision is displayed after the decimal point in the base indicator. To change the precision, use the Display prefs menu item. The maximum precision is 16 decimal digits.

### Full mode

In float mode, a number is normally forced to fit into the available space on the display. If it is too long to fit the way it would normally be displayed, the precision is reduced; that is, trailing decimal places are truncated until it fits. If it is still too long after all decimal places have been truncated (that is, the precision has been reduced to zero), it is displayed in scientific notation. Finally, if it is still too long, it is truncated.

Using the full button, there are two modes you can use to see more of a number that has been truncated. Pressing the full button enters FULL mode. This prevents any truncation from occurring. If the number too long to fit on the display, scroll arrows let you scroll the number left and right. When in FULL mode, the button label changes to FULL. Pressing the FULL button again changes to FULP mode. This temporarily increases the precision to the maximum (16 decimal digits), so that you can quickly view more decimal digits without manually changing the precision. While in FULP mode, the button changes to FULP. Pressing the FULP button again returns to the normal mode.

## Entering units

In float mode, numbers can have units. To enter a number with units, first enter the value of the number, then press a unit button (a button with a unit name on it). Up to 50 units may be assigned to a unit button. There are 25 primary unit buttons and 25 alternate unit buttons. Five unit buttons always appear in the top row of buttons. The other 20 primary unit buttons appear when you press the unit button. Pressing alt makes the 25 alternate unit buttons appear.

If you wish to enter more than one unit, simply press the desired unit buttons in sequence. For example, pressing ft followed by lb enters "ft*lb" (foot-pounds). To enter a unit with an exponent, press the unit more than once. For example, pressing in followed by in again enters "in²" (square inches). To enter a reciprocal unit (a unit with a negative exponent), press the per button before the units with negative exponents. For example, pressing mi followed by per and then hr enters "mi/hr" (miles per hour). You must use the per button to do this; you cannot use the / (divide) button.

To enter a metric prefix on a unit, such as centi- or kilo-, first press the unit button. The seven most common metric prefixes appear in the bottom two rows of buttons. Press one of these prefix buttons followed by the desired unit. For example, pressing c- and then m enters "cm" (centimeters). If you need a prefix that does not appear on the first set of seven prefix buttons, press the pfx button to switch to the second set of prefix buttons. When you do this, the label on the pfx button changes to pfx2. Press the pfx2 button to switch to the third set of prefix buttons. When you do this, the button changes to pfx3. Pressing pfx3 returns to the standard prefix buttons. See the appendix on prefix buttons for a complete list of the metric prefixes.

Unc knows about more than 50 units, so there are units which do not appear on a unit button. To enter a unit that does not currently appear on a unit button, press list. This shows the complete list of units. See the Unit Reference section for a list of all the units. Select one of the units from the list and press Use. You can assign any unit from the list to a unit button if you find you need to use that unit frequently. Use the scroll bar to scroll the unit list, or press the PalmPilot's up and down buttons (the physical buttons on the case). You can also enter a Graffitti letter to jump to the units whose names begin with that letter. In the Windows version, just press the appropriate key on the keyboard.

A shortcut to get to the unit list quickly is to enter a Graffitti letter while entering a number. This switches to the unit list and jumps to the units whose names begin with that letter. In other words, entering a Graffitti letter while entering a number in the calculator display is the same as pressing the list button and then entering the Graffitti letter. Again, in the Windows version, just press the appropriate key on the keyboard.

Each unit is assigned to a category. If you use the indicator in the upper right corner of the unit list to select a category, then only the units in that category will be shown. Select the category "All" to see all the units.

## Converting between units

To convert the top number on the stack to different units, enter the desired unit (thus making the number to be converted the second number on the stack). Then press conv. This changes the units of the second number on the stack to match the units of the (new) top number on the stack, if possible. For example, if "45 km" is the top number on the stack, press mi conv to convert it to miles. Note that when you press conv, the value of the top number is ignored; only its units are relevant.

If the units of the second number on the stack cannot be converted directly into the units of the top number, Unc will do its best to make the desired units appear in the result. Sometimes this will result in a sensible answer. For example, if "5 mi/s" is on top of the stack and you enter ft conv, you will get "26,400 ft/s". Although Unc was not able to convert the result to "feet", it converted it to a unit containing "feet". On the other hand, if you try to convert "5 mi/s" into pounds, you get "17.739981 lb*m/s*g". Again, the result contains "pounds", and is in fact equivalent to 5 mi/s, but this is probably not a very useful unit.

The Make primitive menu item is a quick way to reduce the units of a number to base units. You don't need to enter the desired units; just select the Make primitive menu item and the units of the top number on the stack will be converted to base units.

## Defining new units

Unc has an extensive list of units, and you can add new units to this list. There are two types of units. Base units or primitive units are not defined in terms of other units; they are the "base" on which all other units are built. Examples of base units are "grams", "meters" and "seconds". Derived units are defined in terms of base units or other derived units. For example, an inch is defined as "2.54 cm", a foot is defined as "12 in", and a mile is defined as "5280 ft".

For example, to define a "fortnight" unit, enter "14 day" on the stack, then select the "Define unit" menu item. Enter an abbreviation for the unit (perhaps "ftnt") and press OK. Then either press a button to which to assign ftnt, or press None. You can then use "ftnt" in computations just like any other unit.

To define a new base unit, either clear the stack, or enter a zero (without units) on the stack. Then select the "Define unit" menu item, and proceed as for defining a derived unit. To define a base unit, the top number on the stack may in fact be any number, as long as it has no units.

## Changing and deleting units

### Renaming a unit

To change the name of a unit, display the list of units by pressing the list button. Select the unit from the list. Select the "Rename" menu item and type the new name of the unit. If the unit is assigned to a button or appears in the stack, the name of the unit on the button or on the stack will automatically be changed.

### Redefining a unit

To change the definition of a unit, enter the new defintion of the unit on the stack. Then display the list of units by pressing the list button. Select the unit from the list. Select the "Redefine" menu item and tap the Yes button on the dialog that appears. The new definition must have the same units as the original definition; only the magnitude can change.

### Deleting a unit

To delete a unit, display the list of units by pressing the list button. Select the unit from the list. Select the "Delete" menu item and tap the OK button on the dialog that appears. Warning: if you delete a unit, any other units that are defined in terms of that unit, either directly or indirectly, will also be deleted. For example, deleting "m" (meters) will delete most of the units that are defined! If you are just trying to change a unit, use the Rename or Redefine menu items, rather than deleting and recreating the unit.

## Changing unit buttons

### Assigning a unit to a button

To assign a unit to a button, first enter the unit on the stack. If the unit is not already on a button, you can enter the unit by pressing list, selecting the unit from the list, and pressing Use. Once the unit is on the stack, select the "Set button" menu item. You will be prompted with the message "Key for ...", with the name of the unit. Just press the button to which you want to assign the unit, or press the none button if you change your mind and don't want to assign the unit to a button.

You can assign a unit to any of the 25 primary unit buttons, or press alt to assign it to any of the 25 alternate unit buttons. If you assign a unit to a button which already has a unit, the button's unit is replaced. The old unit will still appear in the unit list. A unit may appear on more than one button.

## Using integer mode

In addition to float mode, Unc can operate in integer mode. In integer mode the base may be any number from 2 through 36, and numbers are integers, which may not have units.

### Changing the base of numbers

 bin Binary (base 2). oct Octal (base 8). dec Decimal (base 10). hex Hexadecimal (base 16). B 3 Base 3, etc. The number after the B indicates the current base. . 10 Float. The number after the decimal point indicates the current precision.

To switch to a different base, tap the base indicator and select the desired base from the list that appears. To switch to an integer base other than 2, 8, 10, or 16, first enter the base on the stack, then tap the base indicator and select the "x (Stack)" item from the list.

Notice that there is a difference between float mode and decimal mode. Although both modes use base 10, in decimal mode numbers are integers and the buttons show the integer functions. In float mode, numbers may have a decimal point and units, and the buttons show the float functions.

When you switch from float mode to integer mode, all the numbers on the stack are rounded to the nearest integer and any units are discarded.

## Some examples of units calculation

Here are some examples of how Unc's built-in units knowlege can make calculations easier.

### 1. Metric conversions

A. You want to convert 28 gallons to liters.

Enter 28. Press the gal button. Press ENT. The display reads "28 gal". Now to convert, press the l button (that's L, for liters) and press conv. The display reads 105.991529952 l".

B. You want to convert 800 kilometers to miles.

Enter 800. Press the km button. Press ENT. The display reads "800 km". Now to convert, press the mi button and press conv. The display reads "497.0969537899 mi".

C. You want to convert 55 miles per hour to kilometers per hour.

Enter 55. Press the mi button, then the per button, then the hr button. Press ENT. The display reads "55 mi/hr". Now to convert, press km per hr and press conv. The display reads "88.51392 km/hr".

### 2. Mixed unit arithmetic

A. You want to express 5 feet 8.5 inches in inches.

Enter 5 and press the ft button. Press ENT. The display reads "5 ft". Enter 8.5 and press the in button. Press +. You've added 5 feet plus 8.5 inches. The display reads "68.5 in". What if you now want it in feet instead of inches? Easy: just press the ft button, then press conv. The display now reads "5.708333333 ft".

B. You want to find the area of a plot of land. You know it's 125 feet 5 inches long, and 16 yards wide.

Enter 125 and press the ft button. Press ENT. The display reads "125 ft". Enter 5 and press the in button. Press +. You've added 125 feet plus 5 inches, and the display reads "1,505 in". Now enter 16 and press the yd button. Press * to multiply. The display reads "668.888888889 yd²". What if you want to see it in square feet? Press ft twice, then conv. The display reads "6,020 ft²".

C. You want to find the volume in gallons of a rectangular swimming pool that is 25 feet long, 16 feet wide, and 6 feet deep.

Enter 25 and press the ft button. Press ENT. The display reads "25 ft". Enter 16 and press the ft button. Press *. The display reads "400 ft²" (that's the area of the surface of the pool). Enter 6 and press the ft button. Press * again. The display reads "2,400 ft³". To convert to gallons, press gal conv. The display reads "17,953.2467532 gal".

### 3. Physics problems

A. Find the force of gravity exerted on a 100 pound mass at sea level.

First enter the mass: enter 100 and press the lb button. Press ENT. The display reads "100 lb". Since force = mass x acceleration, we want to multiply by the Earth's gravitational acceleration. If you don't happen to remember it, you can look it up in the complete units list: press list and find the "grav" entry. Select it and press "Use". Now press * to multiply. The display reads "100 grav*lb". To convert to newtons, for example, press N conv. The display reads "444.8221615261 N".

B. Find the kinetic energy of a 2500 pound car travelling at 60 miles per hour.

Kinetic energy is 1/2 times mass times velocity squared. Enter 2500 and press lb. Enter 2 and press / to divide by 2. The display reads "1,250 lb". Enter 60 and press mi per hr. Press x^2 to square it. The display reads "3,600 mi²/hr²". Press * to multiply. The display reads "4.5 e6 mi²*lb/hr²". To convert to joules, press J conv. The display reads "407,916.26570803 J".

### 4. Fun stuff

A. Find the volume of the earth in teaspoons.

The radius of the earth is about 4000 miles. Enter 4000 and press mi. Using the formula for the volume of a sphere (4/3 * pi * radius cubed), press x^3, enter 4 and press *. Enter 3 and press /. Enter pi and press *. The display reads "2.68082573 e11 mi³". This is the volume of the earth in cubic miles. To convert to teaspoons, press tsp conv. The display reads "2.26706164 e26 tsp".

B. How big an area would be needed if everyone on earth were gathered in one place?

Assume each person uses about 6 square feet. Multiply by the earth's population of about 5 billion: enter 6 and press ft ft. Enter 5 EEX 9 and press *. The display reads "30,000,000,000 ft²". If the people were arranged in a square, one side of the square would be the square root of this number. Press sqrt. The display reads "173,205.0807569 ft". To convert to miles, press mi conv. The display reads "32.8039925676 mi". The population of earth would fit in a square about 32 miles on a side, about 60% larger than the island of Zanzibar.

# Frequently Asked Questions

### Can Unc convert temperatures?

Currently Unc cannot do conversions that involve both multiplying AND adding a conversion factor. For example, converting a temperature measurement in degrees Celsius to degrees Fahrenheit involves multipying by 1.8 and adding 32. The main problem is that there is an inherent ambiguity in this type of temperature conversion, depending on whether the number being converted is interpreted as an absolute measurement, or as a relative difference between measurements. For example, as an absolute measurement 10 degC = 50 degF. But if the temperature rises from 5 degC to 15 degC (41 degF to 59 degF), that's a rise of 10 degC, but it's NOT a rise of 50 degF! There's no obvious way for Unc to know where a number came from, and therefore what type of conversion to apply. The problem also appears when temperature units are combined with other units. A temperature gradient of 10 degC/ft is NOT equal to 50 degF/ft. You can always do simple multiplicative temperature conversions, as long as you remember that absolute temperature measurements still need the offset (32) added or subtracted. But to avoid confusion, Unc does not come with predefined temperature units.

# Reference Manual

## Menu items on the calculator display

### Undo

Restores the stack to its contents before the last arithmetic operation. This only works for arithmetic operations, which operate on the top number or top two numbers on the stack. You cannot undo operations that affect the whole stack, like CLR, BSP, up and dn.

### Copy

Copies the number on the top of the stack to the Clipboard.

### Paste

Pushes the number in the Clipboard to the top of the stack. The number you are pasting cannot have units.

### Define unit

Defines a new unit. The definition of the unit is the value of the top number on the stack.

### Set button

Assigns the unit of the top number on the stack to a button. Prompts you to press the button to which the unit is to be assigned. Only the unit portion of the number is used; the numeric portion of the number is ignored. If the stack is empty or if the top number does not have units, the button pressed will be cleared; that is, it will not be assigned a unit.

### Make primitive

Converts the units of the top number on the stack to "primitive" or "base" units.

### Import

(Only in the Windows version.)
Imports a set of units from a text file. All existing units are discarded and replaced with the new ones.

### Export

(Only in the Windows version.)
Exports the current set of units to a text file.

### Display

In float mode, allows you to select the current display mode.

### Preferences

Displays the Preferences dialog, which lets you set some options.

Stack size
Sets the maximum size of the stack. The stack size may be any number between 4 and 128. Setting a larger stack size will use more of the PalmPilot's memory.
Warn about integer overflow
Displays a warning message if an arithmetic operation causes high-order bits to be lost because they overflowed the current word size. Also displays a warning if converting from float mode to an integer base causes high-order bits to be lost.
Simplify units in multiply/divide
Causes multiplication and division to try to convert the resulting units to a simpler form. If this box is unchecked, then multiplication and division will leave the resulting units as a simple combination of the units of the two operand numbers. For example, suppose you multiply "20 mi/hr" by "60 min". If this box is checked the result will be "20 mi". If this box is unchecked, the result wil be "1200 mi*min/hr".
Inverse trig result gets units
Causes the result of an inverse trig function (asin, acos or atan) to have the appropriate unit. In degrees mode, the unit is "adeg"; in radians mode the unit is "rad". If this box is unchecked, the result of an inverse trig function is a plain number, without units.
Ask before clearing stack
If checked, when the CLR button is pressed, you will be asked for confirmation before the stack is cleared.
HP stack mode
If checked, the stack operates somewhat differently than described in this document. There are always exactly N numbers on the stack, where N is the stack size. When a number is popped off the top of the stack, another copy of the number at the bottom of the stack is added to the bottom, to ensure that the stack size remains unchanged. Also, when you press ENTER while entering a number, two copies of the number are pushed onto the stack. However, the top number is immediately discarded if you begin entering another number. All this weirdness is designed to make the stack's behavior more familiar to users accustomed to using HP calculators.

### Display prefs

Displays the Display Preferences dialog, which lets you set some options which control the display of numbers.

Precision
Sets the precision (the maximum digits displayed to the right of the decimal point). The precision must be between 0 and 16. Changing the precision only affects the display of numbers; it does not affect how the numbers are stored internally.
Digits between separators
Sets the separator spacing value for each of the bases.

Displays information about the version of Unc you are using.

## Menu items on the unit list

### Delete

Deletes the selected unit. This completely removes the unit from Unc's knowlege. It also removes any units that depend on the deleted unit, either directly or indirectly. Any buttons which are assigned a unit being deleted will be cleared. Any numbers on the stack which contain the unit being deleted will have their units removed.

### Rename

Changes the name of the selected unit.

### Redefine

Changes the definition of the selected unit. The new definition of the unit is the value of the top number on the stack. The new definition must have the same units as the original definition; only the magnitude can change.

## Menu items on the memory screen

### Clear Selection

Sets the selected memory location to zero.

### Clear All

Sets all memory locations to zero.

## Buttons

### ` + `

Adds the two numbers on top of the stack and replaces them with the result. If the two numbers have units and they are not the same, Unc will attempt to convert the second number into the units of the top number.

### ` - `

Subtracts the two numbers on top of the stack and replaces them with the result. If the two numbers have units and they are not the same, Unc will attempt to convert the second number into the units of the top number.

### ` * `

Multiplies the two numbers on top of the stack and replaces them with the result.

### ` / `

Divides the two numbers on top of the stack and replaces them with the result.

### ` +/- `

Changes the sign of the top number on the stack. If pressed while entering a number, changes the sign of the number being entered. If pressed while entering the exponent of a number in scientific notation (after pressing EEX), changes the sign of the exponent being entered.

### ` 1/x `

Replaces the number on top of the stack with its reciprocal (1 divided by the number).

### ` 10^x `

Replaces the number on top of the stack with 10 raised to the power of that number. The number may not have units.

### ` acos `

Replaces the number on top of the stack with the inverse cosine (arc cosine) of the number. In degrees mode, the result is in degrees; in radians mode, the result is in radians. If the "Inverse trig result gets units" preference is set, the result will have the "rad" or "adeg" unit. (The "rad" and "adeg" units must be properly defined for this to work.)

### ` acosh `

Replaces the number on top of the stack with the inverse hyperbolic cosine of the number.

### ` alt `

Switches all buttons to their "alternate" form.

### ` and `

Performs a logical AND of the two numbers on top of the stack and replaces them with the result.

### ` and~ `

Performs a logical AND of the second number on the stack and the logical NOT of the top number on the stack and replaces them with the result.

### ` asin `

Replaces the top number on the stack with the inverse sine (arc sine) of the number. In degrees mode, the result is in degrees; in radians mode, the result is in radians. If the "Inverse trig result gets units" preference is set, the result will have the "rad" or "adeg" unit. (The "rad" and "adeg" units must be properly defined for this to work.)

### ` asinh `

Replaces the number on top of the stack with the inverse hyperbolic sine of the number.

### ` atan `

Replaces the top number on the stack with the inverse tangent (arc tangent) of the number. In degrees mode, the result is in degrees; in radians mode, the result is in radians. If the "Inverse trig result gets units" preference is set, the result will have the "rad" or "adeg" unit. (The "rad" and "adeg" units must be properly defined for this to work.)

### ` atanh `

Replaces the number on top of the stack with the inverse hyperbolic tangent of the number.

### ` BSP `

Pops (deletes) the number on top of the stack. If pressed while entering a number, deletes the last character which was entered.

### ` bswp `

Performs a byte-swap of the number on top of the stack and replaces it with the result.

### ` cbrt `

Replaces the number on top of the stack with its cube root. If the number has units, the exponent of all units in the number must be a multiple of three.

### ` CLR `

Deletes all numbers in the stack.

### ` conv `

Converts the units of the second number on the stack to match the units of the top number on the stack.

### ` cos `

Replaces the top number on the stack with its cosine. If the number has units, it must be possible to convert the units to a unit named "rad", which is interpreted as radians. If the number has no units, in degrees mode, the number is interpreted as degrees; in radians mode, the number is interpreted as radians.

### ` cosh `

Replaces the top number on the stack with its hyperbolic cosine.

### ` deg / rad `

Switches between degrees mode and radians mode. While in degrees mode, the button will be labeled deg; while in radians mode, the button will be labeled rad. In degrees mode, the input number to trig functions (sin, cos and tan) is assumed to be degrees, unless it has a unit. The result of inverse trig functions (asin, acos and atan) will be in degrees. In radians mode, the input number to trig functions is assumed to be radians, unless it has a unit, and the result of inverse trig functions will be in radians.

### ` dn `

"Rolls" the stack down. The top number on the stack is moved to the bottom of the stack, and all the other numbers are shifted accordingly.

### ` e^x `

Replaces the top number on the stack with e (the base of the natural logarithm) raised to the power of that number. The number may not have units.

### ` EEX `

Begins entering the exponent of a number in scientific notation.

### ` ENT `

Pushes the number being entered on the top of the stack. If pressed while not entering a number, pushes another copy of the top number on the stack.

### ` full `

Switches between normal mode, FULL mode, and FULP mode. In normal mode, numbers are forced to fit in the available display space. In FULL mode, numbers scroll if they are too long to fit in the available display space. FULP mode is like FULL, but in addition the precision is temporarily increased to the maximum.

### ` hyp `

Switches the trigonometric buttons sin, cos, tan to the hyperbolic functions sinh, cosh, tanh. While in this mode, the label of this button changes to HYP. Pressing HYP again restores the trigonometric buttons.

### ` list `

Displays the list of all units. Use the scroll bar at the right of the display to navigate in the list. You can also use the PalmPilot's up and down (physical) buttons to scroll in the list, or you can write a Graffitti letter to scroll to the first unit which begins with that letter.

### ` ln `

Replaces the top number on the stack with its natural logarithm (logarithm to the base e).

### ` log `

Replaces the top number on the stack with its common logarithm (logarithm to the base 10).

### ` m< `

Replaces the top number on the stack with a "left mask", consisting of N high-order one bits and the rest zeros, where N is the top number on the stack.

### ` m> `

Replaces the top number on the stack with a "right mask", consisting of N low-order one bits and the rest zeros, where N is the top number on the stack.

### ` m2< `

Creates a "left mask", consisting of N high-order one bits and the rest zeros, where N is the second number on the stack. This mask is then shifted right M bits, where M is the top number on the stack, and the top two numbers on the stack are replaced with the result.

### ` m2> `

Creates a "right mask", consisting of N low-order one bits and the rest zeros, where N is the second number on the stack. This mask is then shifted left M bits, where M is the top number on the stack, and the top two numbers on the stack are replaced with the result.

### ` mem `

Displays the memory screen.

### ` mod `

Divides the top two numbers on the stack and replaces them with the remainder of the division.

### ` not `

Replaces the top number on the stack with its logical NOT.

### ` or `

Performs a logical OR of the two numbers on top of the stack and replaces them with the result.

### ` or~ `

Performs a logical OR of the second number on the stack and the logical NOT of the top number on the stack and replaces them with the result.

### ` pad `

Enables and disables pad mode. In pad mode, numbers are displayed with leading zeros. While in pad mode, the button will be labeled PAD; while not in pad mode, the button will be labeled pad.

### ` per `

Begins entering units with negative exponents.

### ` pi `

Pushes the number pi on the stack.

### ` r< `

Rotates the number on top of the stack left by one bit and replaces it with the result.

### ` r> `

Rotates the number on top of the stack right by one bit and replaces it with the result.

### ` r2< `

Rotates the second number on top of the stack left by N bits, where N is the top number on the stack, and replaces both numbers with the result.

### ` r2> `

Rotates the second number on top of the stack right by N bits, where N is the top number on the stack, and replaces both numbers with the result.

### ` s< `

Shifts the number on top of the stack left by one bit and replaces it with the result.

### ` s> `

Shifts the number on top of the stack right by one bit and replaces it with the result. In unsigned mode, the high order bit is set to zero; in signed mode, the high order bit is set to a copy of the sign bit of the original number.

### ` s2< `

Shifts the second number on the stack left by N bits, where N is the number on top of the stack. and replaces both numbers with the result.

### ` s2> `

Shifts the second number on the stack right by N bits, where N is the number on top of the stack. and replaces both numbers with the result. In unsigned mode, the high order bits are set to zero; in signed mode, the high order bits are set to a copy of the sign bit of the original number.

### ` sign / usign `

Switches between signed mode and unsigned mode. While in signed mode, the button will be labeled sign; while in unsigned mode, the button will be labeled usign.

### ` sin `

Replaces the top number on the stack with its sine. If the number has units, it must be possible to convert the units to a unit named "rad", which is interpreted as radians. If the number has no units, in degrees mode, the number is interpreted as degrees; in radians mode, the number is interpreted as radians.

### ` sinh `

Replaces the top number on the stack with its hyperbolic sine.

### ` sqrt `

Replaces the number on top of the stack with its square root. If the number has units, the exponent of all units in the number must be a multiple of two.

### ` tan `

Replaces the top number on the stack with its tangent. If the number has units, it must be possible to convert the units to a unit named "rad", which is interpreted as radians. If the number has no units, in degrees mode, the number is interpreted as degrees; in radians mode, the number is interpreted as radians.

### ` tanh `

Replaces the top number on the stack with its hyperbolic tangent.

### ` unit `

Displays the 25 primary unit buttons and the unit prefixes. Pressing alt displays the 25 alternate unit buttons.

### ` up `

"Rolls" the stack up. The bottom number on the stack is moved to the top of the stack, and all the other numbers are shifted accordingly.

### ` word `

Change the word size.

### ` x^2 `

Replaces the number on top of the stack with its square.

### ` x^3 `

Replaces the number on top of the stack with its cube.

### ` xor `

Performs a logical XOR (exclusive OR) of the two numbers on top of the stack and replaces them with the result.

### ` xor~ `

Performs a logical XOR (exclusive OR) of the second number on the stack and the logical NOT of the top number on the stack and replaces them with the result.

### ` y^/ `

Raises the second number on the stack to the power of the reciprocal of the first number on the stack, and replaces both numbers with the result. The exponent may not have units. If the number being exponentiated has units, the other number must be an integer, and the exponents of the units must all be multiples of that number.

### ` y^x `

Raises the second number on the stack to the power of the first number on the stack, and replaces both numbers with the result. The exponent may not have units. If the number being exponentiated has units, the other number must be an integer.

### Unit buttons

Pressing any of the 50 unit buttons appends that unit to the number being entered.

### Prefix buttons

Pressing any of the prefix buttons appends that prefix to the number being entered. The prefix should be followed immediately by a unit button, which causes the prefix to affect that unit.

There are three sets of prefix buttons. Switch between them by pressing the pfx button.

The first set of prefix buttons is:

 c- centi- (10 ^ -2) m- milli- (10 ^ -3) u- micro- (10 ^ -6) n- nano- (10 ^ -9) k- kilo- (10 ^ 3) M- mega- (10 ^ 6) G- giga- (10 ^ 9)

The second set of prefix buttons is:

 d- deci- (10 ^ -1) p- pico- (10 ^ -12) f- femto- (10 ^ -15) a- atto- (10 ^ -18) D- deca- (10 ^ 1) H- hecta- (10 ^ 2) T- tera- (10 ^ 12)

The third set of prefix buttons is:

 P- peta- (10 ^ 15) E- exa- (10 ^ 18) Z- zetta- (10 ^ 21) Y- yotta- (10 ^ 24) z- zepto- (10 ^ -21) y- yocto- (10 ^ -24)

## Unit Reference

These are the predefined US units. The UK units are the same, except that units which begin with "UK" in this list do not have the "UK" prefix in the UK list, and units marked with "(US)" in this list have a "US" prefix in the UK list.

Abbreviation Definition Full name Comments
` A `` (Base unit) ` Ampere
` acre `` 4,840 yd² ` Acre
` adeg `` 0.0174532925 rad ` Angular degree
` amin `` 0.0166666666 adeg ` Angular minute
` asec `` 0.0166666666 amin ` Angular second
` amu `` 1.66033 e-27 kg ` Atomic mass unit One twelfth the mass of a carbon-12 atom
` a `` 100 m² ` Are A hectare is 1 Ha
` atm `` 101,325 Pa ` Atmosphere Standard atmosphere (pressure)
` ATS `` .07267283 EUR ` (Austria) Schilling
` au `` 149,600,000,000 m ` Astronomical unit Mean distance from Earth to the Sun
` B `` 8 bit ` Byte
` bar `` 100,000 Pa ` Bar
` bbl `` 7,056 in³ ` Barrel
` BEF `` .02478935 EUR ` (Belgium) Franc
` bit `` (Base unit) ` Bit
` btu `` 1,055.055863 J ` British thermal unit International BTU
` bu `` 4 pk ` Bushel (US) Dry measure
` C `` 1 A*s ` Coloumb
` c `` 299,792,458 m/s ` Speed of light
` cal `` 4.1868 J ` Calorie International table calorie
` carat `` 4 grain ` Carat Troy measure
` cc `` 1 cm³ ` Cubic centimeter
` cd `` (Base unit) ` Candela
` cmHg `` 1,333.22387415 Pa ` Centimeters of mercury
` cup `` 0.5 pt ` Cup (US)
` cwt `` 112 lb ` Hundredweight Avoirdupois measure
` cwttr `` 100 lbtr ` Hundredweight (troy) Troy measure
` day `` 24 hr ` Day Mean solar day
` daysid `` 86,164.09892 s ` Day (sidereal) Sidereal day
` DEM `` .5112919 EUR ` (Germany) Mark
` dram `` 60 grain ` Dram or drachm Apothecaries' measure
` drygal `` 4 dryqt ` Dry gallon
` drypt `` 0.55061 l ` Dry pint
` dryqt `` 2 drypt ` Dry quart
` dwt `` 24 grain ` Pennyweight Troy measure
` dyn `` 1 e-5 N ` Dyne
` e `` 1.60219 e-19 C ` Charge of electron
` erg `` 1 e-7 J ` Erg
` ESP `` .006010121 EUR ` (Spain) Peseta
` EUR `` (Base unit) ` Euro
` eV `` 1.6021 e-19 J ` Electron volt
` F `` 1 C/V ` Farad
` fathom `` 6 ft ` Fathom
` fdy `` 96,487 C ` Faraday
` FIM `` .1681879 EUR ` (Finland) Markka
` fldr `` 0.125 floz ` Fluid dram (US)
` floz `` 0.25 gill ` Fluid ounce (US)
` ft `` 12 in ` Foot
` FRF `` .1524490 EUR ` (France) Franc
` fur `` 660 ft ` Furlong
` g `` (Base unit) ` Gram or gramme
` G `` 6.672 e-11 N*m²/kg² ` Gravitational constant
` gal `` 231 in³ ` Gallon (US)
` GB `` 1,024 MB ` Gigabyte
` gill `` 0.5 cup ` Gill (US)
` grain `` 6.479891 e-5 kg ` Grain Avoirdupois, apothecaries' and troy measure
` grav `` 9.80665 m/s² ` Gravity Gravitational acceleration of Earth
` Gs `` 1 e-4 T ` Gauss
` H `` 1 Wb/A ` Henry
` hp `` 550 ft*lbf/s ` Horsepower Imperial (or British) horsepower
` hr `` 60 min ` Hour
` Hz `` 1 1/s ` Hertz
` IEP `` 1.269738 EUR ` (Ireland) Pound
` in `` 2.54 cm ` Inch
` inHg `` 3,386.388640341 Pa ` Inches of mercury
` ITL `` .0005164569 EUR ` (Italy) Lira
` J `` 1 N*m ` Joule
` KB `` 1,024 B ` Kilobyte
` kn `` 1 nmi/hr ` Knot (US)
` l `` 0.001 m³ ` Liter
` L `` 0.3183098862 cd/cm² ` Lambert
` lb `` 0.4535923745 kg ` Pound Measure of mass
` lbf `` 4.4482216153 N ` Pound force Measure of force
` lbtr `` 12 oztr ` Pound (troy) Troy measure
` longton `` 2,240 lb ` Long ton
` LUF `` .02478935 EUR ` (Luxembourg) Franc
` lyr `` 1 c*yr ` Light year
` m `` (Base unit) ` Meter or metre
` MB `` 1,024 KB ` Megabyte
` mho `` 1 A/V ` Mho Same as siemens
` mi `` 5,280 ft ` Mile
` min `` 60 s ` Minute (time)
` Mx `` 1 e-8 Wb ` Maxwell
` N `` 1 kg*m/s² ` Newton
` NLG `` .4537802 EUR ` (Netherlands) Guilder
` nmi `` 1,852 m ` Nautical mile (US) International nautical mile
` nt `` 1 cd/m² ` Nit
` ohm `` 1 V/A ` Ohm
` oz `` 0.0625 lb ` Ounce
` oztr `` 480 grain ` Ounce (troy) Troy and apothecaries' measure
` Pa `` 1 N/m² ` Pascal
` pc `` 3.08572 e16 m ` Parsec
` pdl `` 1 ft*lb/s² ` Poundal
` pk `` 2 drygal ` Peck (US)
` psi `` 1 lbf/in² ` Pounds per square inch
` pt `` 0.5 qt ` Pint (US)
` PTE `` .004987979 EUR ` (Portugal) Escudo
` qt `` 0.25 gal ` Quart (US)
` rad `` (Base unit) ` Radian
` rod `` 5.5 yd ` Rod
` s `` (Base unit) ` Second
` S `` 1 A/V ` Siemens Same as mho
` sb `` 1 cd/cm² ` Stilb
` scrup `` 20 grain ` Scruple Apothecaries' measure
` slug `` 14.5939 kg ` Slug
` stone `` 14 lb ` Stone
` T `` 1 Wb/m² ` Tesla
` TB `` 1,024 GB ` Terabyte
` tbsp `` 0.5 floz ` Tablespoon (US)
` ton `` 2,000 lb ` Ton
` tonne `` 1,000 kg ` Tonne (metric)
` tontr `` 2,000 lbtr ` Ton (Troy) Troy measure
` torr `` 133.34436821 Pa ` Torr
` tsp `` 0.3333333333 tbsp ` Teaspoon (US)
` UKbu `` 4 UKpk ` Bushel (UK)
` UKcup `` 0.5 UKpt ` Cup (UK)
` UKfldr `` 0.125 UKfloz ` Fluid dram (UK)
` UKfloz `` 0.2 UKgill ` Fluid ounce (UK)
` UKgal `` 4.54609 l ` Gallon (UK)
` UKgill `` 0.5 UKcup ` Gill (UK)
` UKkn `` 1 UKnmi/hr ` Knot (UK)
` UKnmi `` 6,080 ft ` Nautical mile (UK)
` UKpk `` 2 UKgal ` Peck (UK)
` UKpt `` 0.5 UKqt ` Pint (UK)
` UKqt `` 0.25 UKgal ` Quart (UK)
` UKtbsp `` 0.5 UKfloz ` Tablespoon (UK)
` UKtsp `` 0.3333333333 UKtbsp ` Teaspoon (UK)
` V `` 1 W/A ` Volt
` W `` 1 J/s ` Watt
` Wb `` 1 V*s ` Weber
` yd `` 3 ft ` Yard
` yr `` 365.2421991 day ` Year (tropical) Time between 2 passages of the Sun through Earth's equatorial plane
` yrsid `` 365.2563542 day ` Year (sidereal) Time during which Earth returns to the same point in its orbit, relative to the stars

## Limitations and deficiencies

1. You cannot Paste a number containing units.
2. If a number is more than 99 digits long, the scrolling indicators might not correctly show the number of off-screen digits.

## Bibliography

Cook, James L. Conversion Factors. Oxford: Oxford University Press, 1991.

Dresner, Stephen. Units of Measurement. Aylesbury: Harvey Miller & Medcalf Ltd., 1971.

Selby, Samuel, ed. CRC Standard Mathematical Tables, Twenty-third Edition. Cleveland: CRC Press, 1975.