www.delorie.com/gnu/docs/units/units_6.html   search  
Buy GNU books!

Units: A Unit Conversion Program

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Unit definitions

The conversion information is read from a units data file which is called `units.dat' and is probably located in the `/usr/local/share' directory. If you invoke units with the `-V' option, it will print the location of this file. The default file includes definitions for all familiar units, abbreviations and metric prefixes. It also includes many obscure or archaic units.

Many constants of nature are defined, including these:
pi          ratio of circumference to diameter
c           speed of light
e           charge on an electron
force       acceleration of gravity
mole        Avogadro's number
water       pressure per unit height of water
Hg          pressure per unit height of mercury
au          astronomical unit
k           Boltzman's constant
mu0         permeability of vacuum
epsilon0    permitivity of vacuum
G           Gravitational constant
mach        speed of sound

The database includes atomic masses for all of the elements and numerous other constants. Also included are the densities of various ingredients used in baking so that `2 cups flour_sifted' can be converted to `grams'. This is not an exhaustive list. Consult the units data file to see the complete list, or to see the definitions that are used.

The unit `pound' is a unit of mass. To get force, multiply by the force conversion unit `force' or use the shorthand `lbf'. (Note that `g' is already taken as the standard abbreviation for the gram.) The unit `ounce' is also a unit of mass. The fluid ounce is `fluidounce' or `floz'. British capacity units that differ from their US counterparts, such as the British Imperial gallon, are prefixed with `br'. Currency is prefixed with its country name: `belgiumfranc', `britainpound'.

The US Survey foot, yard, and mile can be obtained by using the `US' prefix. These units differ slightly from the international length units. They were in general use until 1959, and are still used for geographic surveys. The acre is officially defined in terms of the US Survey foot. If you want an acre defined according to the international foot, use `intacre'. The difference between these units is about 4 parts per million. The British also used a slightly different length measure before 1959. These can be obtained with the prefix `UK'.

When searching for a unit, if the specified string does not appear exactly as a unit name, then the units program will try to remove a trailing `s' or a trailing `es'. If that fails, units will check for a prefix. All of the standard metric prefixes are defined.

To find out what units and prefixes are available, read the standard units data file.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003