blob: 445c2196715aa858decee9fa124449999457dbf1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
.if n .ds / /
.if t .ds / \z/\h'\w'*'u'
.TH UNITS 7
.CT 1 inst_info
.SH NAME
units \- conversion program
.SH SYNOPSIS
.B units
.SH DESCRIPTION
.I Units
converts quantities expressed
in various standard scales to
their equivalents in other scales.
It works interactively in this fashion:
.PP
.EX
You have: inch
You want: cm
* 2.54
/ 0.393701
.EE
.PP
Quantities are specified using the following grammar:
.TP
.IR Unit :
.I Empty
|\|
.I Unit Term
|\|
.IB Unit " / " Term
.TP
.IR Term :
.I Number
|\|
.I Name
|\|
.BI ( " Unit " )
|\|
.br
.BI square " Term
|\|
.BI sq " Term
|\|
.BI cube " Term
|\|
.BI cu " Term
|\|
.br
.IB Term " ^ " Number
.ig
.PP
\fIUnit\fP: \fIEmpty\fP
\fIUnit\fP \fITerm\fP
\fIUnit\fP \fL/\fP \fITerm\fP
\fITerm\fP: \fINumber\fP
\fIName\fP
\fL(\fP \fIUnit\fP \fL)\fP
\fLsquare\fP \fITerm\fP
\fLsq\fP \fITerm\fP
\fLcube\fP \fITerm\fP
\fLcu\fP \fITerm\fP
\fITerm\fP \fL^\fP \fINumber\fP
.fi
..
.PP
Numbers are specified in the form expected by
.IR atof (3).
Names are maximal strings of non-numeric, non-punctuation characters.
Powers are indicated by the
.L ^
operator or by the words
.L square
.RL ( sq )
and
.L cube
.RL ( cu ).
Parentheses alter grouping.
The empty unit has value 1.
Terms are multiplied together unless connected by
.L /
for inversion, e.g.
.LR "15 pounds force/sq in" .
.PP
Most familiar units,
abbreviations, and metric prefixes are recognized,
together with a generous leavening of exotica
and a few constants of nature including:
.IP
.de fq
\f5\\$1\\fP \\$2 \\$3 \\$4 \\$5 \\$6
..
.nf
.fq pi ratio of circumference to diameter
.fq c speed of light
.fq e charge on an electron
.fq g acceleration of gravity
.fq force same as \f5g\fP
.fq mole Avogadro's number
.fq water "pressure head per unit height of water"
.fq au astronomical unit
.fi
.PP
The
.L pound
is a unit of
mass.
Compound names are run together, e.g.
.LR lightyear .
British units that differ from their US counterparts
are prefixed thus:
.LR brgallon .
Currency is denoted
.LR belgiumfranc ,
.LR britainpound ,
etc.
.PP
A response of
.L ?
to `You want:' displays all known units
conformable with the `You have:' quantity.
.PP
The complete list of units can be found in
.F /usr/lib/Units
and
.FR /n/alice/usr/td/Monetary.units .
.SH FILES
.F /usr/lib/Units
.br
.F /n/alice/usr/td/Monetary.units
.br
.F /usr/lib/Units.bin
.SH BUGS
Since
.I units
does only multiplicative scale changes,
it can convert Kelvin to Rankine, but not Centigrade to
Fahrenheit.
.br
Currency conversions are only as accurate as the most recent report of
foreign exchange prices from the AP wire.
|