12 .Op Ar from-unit to-unit
14 The following options are available:
15 .Bl -tag -width indent
17 Specify the name of the units data file to load.
19 Suppress prompting of the user for units and the display of statistics
20 about the number of units loaded.
22 If the default unit file exists prints its location. If not, print
24 Units data file not found
27 Print the version number, usage, and then exit.
28 .It Ar from-unit to-unit
29 Allow a single unit conversion to be done directly from the command
31 The program will not print prompts.
33 result of the single specified conversion.
35 Print the units in the conversion output. Be more verbose in general.
40 program converts quantities expressed in various scales to
41 their equivalents in other scales.
45 handle multiplicative or affine scale changes.
46 It works interactively by prompting
60 You want: furlongs/fortnight
74 Powers of units can be specified using the '^' character as shown in
75 the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'.
76 Multiplication of units can be specified by using spaces, a dash or
78 Division of units is indicated by the slash ('/').
79 Note that multiplication has a higher precedence than division,
80 so 'm/s/s' is the same as 'm/s^2' or 'm/s s'.
82 must be indicated using the vertical bar ('|').
84 meter, you would write '1|2 meter'.
85 If you write '1/2 meter' then the
86 units program would interpret that as equivalent to '0.5/meter'.
87 If you enter incompatible unit types, the units program will
88 print a message indicating that the units are not conformable and
89 it will display the reduced form for each unit:
92 You want: fathoms kg^2 / day
94 2.7777778e-11 kg m^2 / sec^3
95 2.1166667e-05 kg^2 m / sec
98 The conversion information is read from a units data file.
100 file includes definitions for most familiar units, abbreviations and
102 Some constants of nature included are:
104 .Bl -column -offset indent -compact "mercury"
105 .It "pi ratio of circumference to diameter"
106 .It "c speed of light"
107 .It "e charge on an electron"
108 .It "g acceleration of gravity"
109 .It "force same as g"
110 .It "mole Avogadro's number"
111 .It "water pressure per unit height of water"
112 .It "mercury pressure per unit height of mercury"
113 .It "au astronomical unit"
116 The unit 'pound' is a unit of mass.
117 Compound names are run together
118 so 'pound force' is a unit of force.
119 The unit 'ounce' is also a unit
121 The fluid ounce is 'floz'.
122 British units that differ from
123 their US counterparts are prefixed with 'br', and currency is prefixed
124 with its country name: 'belgiumfranc', 'britainpound'.
126 for a unit, if the specified string does not appear exactly as a unit
129 will try to remove a trailing 's' or a
130 trailing 'es' and check again for a match.
132 To find out what units are available read the standard units file.
133 If you want to add your own units you can supply your own file.
134 A unit is specified on a single line by
135 giving its name and an equivalence.
137 new units in terms of old ones so that a reduction leads to the
138 primitive units which are marked with '!' characters.
141 program will not detect infinite loops that could be caused
142 by careless unit definitions.
143 Comments in the unit definition file
144 begin with a '/' character at the beginning of a line.
146 Prefixes are defined in the same was as standard units, but with
147 a trailing dash at the end of the prefix name.
148 If a unit is not found
149 even after removing trailing 's' or 'es', then it will be checked
150 against the list of prefixes.
151 Prefixes will be removed until a legal
152 base unit is identified.
154 Here is an example of a short units file that defines some basic
157 .Bl -column -offset indent -compact "minute"
168 .Bl -tag -width /usr/share/misc/units.lib -compact
169 .It Pa /usr/share/misc/units.lib
170 the standard units library
173 .An Adrian Mariano Aq adrian@cam.cornell.edu
175 The effect of including a '/' in a prefix is surprising.
177 Exponents entered by the user can be only one digit.
178 You can work around this by multiplying several terms.
180 The user must use | to indicate division of numbers and / to
181 indicate division of symbols.
182 This distinction should not
185 The program contains various arbitrary limits on the length
186 of the units converted and on the length of the data file.
188 The program should use a hash table to store units so that
189 it does not take so long to load the units list and check