]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bc/manuals/dc/EHNP.1
Upgrade to version 3.3.0
[FreeBSD/FreeBSD.git] / contrib / bc / manuals / dc / EHNP.1
1 .\"
2 .\" SPDX-License-Identifier: BSD-2-Clause
3 .\"
4 .\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions are met:
8 .\"
9 .\" * Redistributions of source code must retain the above copyright notice,
10 .\"   this list of conditions and the following disclaimer.
11 .\"
12 .\" * Redistributions in binary form must reproduce the above copyright notice,
13 .\"   this list of conditions and the following disclaimer in the documentation
14 .\"   and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 .\" POSSIBILITY OF SUCH DAMAGE.
27 .\"
28 .TH "DC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
29 .SH Name
30 .PP
31 dc - arbitrary-precision decimal reverse-Polish notation calculator
32 .SH SYNOPSIS
33 .PP
34 \f[B]dc\f[R] [\f[B]-hiPvVx\f[R]] [\f[B]\[en]version\f[R]]
35 [\f[B]\[en]help\f[R]] [\f[B]\[en]interactive\f[R]]
36 [\f[B]\[en]no-prompt\f[R]] [\f[B]\[en]extended-register\f[R]]
37 [\f[B]-e\f[R] \f[I]expr\f[R]]
38 [\f[B]\[en]expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R]
39 \f[I]file\f[R]\&...] [\f[B]-file\f[R]=\f[I]file\f[R]\&...]
40 [\f[I]file\f[R]\&...]
41 .SH DESCRIPTION
42 .PP
43 dc(1) is an arbitrary-precision calculator.
44 It uses a stack (reverse Polish notation) to store numbers and results
45 of computations.
46 Arithmetic operations pop arguments off of the stack and push the
47 results.
48 .PP
49 If no files are given on the command-line as extra arguments (i.e., not
50 as \f[B]-f\f[R] or \f[B]\[en]file\f[R] arguments), then dc(1) reads from
51 \f[B]stdin\f[R].
52 Otherwise, those files are processed, and dc(1) will then exit.
53 .PP
54 This is different from the dc(1) on OpenBSD and possibly other dc(1)
55 implementations, where \f[B]-e\f[R] (\f[B]\[en]expression\f[R]) and
56 \f[B]-f\f[R] (\f[B]\[en]file\f[R]) arguments cause dc(1) to execute them
57 and exit.
58 The reason for this is that this dc(1) allows users to set arguments in
59 the environment variable \f[B]DC_ENV_ARGS\f[R] (see the \f[B]ENVIRONMENT
60 VARIABLES\f[R] section).
61 Any expressions given on the command-line should be used to set up a
62 standard environment.
63 For example, if a user wants the \f[B]scale\f[R] always set to
64 \f[B]10\f[R], they can set \f[B]DC_ENV_ARGS\f[R] to \f[B]-e 10k\f[R],
65 and this dc(1) will always start with a \f[B]scale\f[R] of \f[B]10\f[R].
66 .PP
67 If users want to have dc(1) exit after processing all input from
68 \f[B]-e\f[R] and \f[B]-f\f[R] arguments (and their equivalents), then
69 they can just simply add \f[B]-e q\f[R] as the last command-line
70 argument or define the environment variable \f[B]DC_EXPR_EXIT\f[R].
71 .SH OPTIONS
72 .PP
73 The following are the options that dc(1) accepts.
74 .TP
75 \f[B]-h\f[R], \f[B]\[en]help\f[R]
76 Prints a usage message and quits.
77 .TP
78 \f[B]-v\f[R], \f[B]-V\f[R], \f[B]\[en]version\f[R]
79 Print the version information (copyright header) and exit.
80 .TP
81 \f[B]-i\f[R], \f[B]\[en]interactive\f[R]
82 Forces interactive mode.
83 (See the \f[B]INTERACTIVE MODE\f[R] section.)
84 .RS
85 .PP
86 This is a \f[B]non-portable extension\f[R].
87 .RE
88 .TP
89 \f[B]-P\f[R], \f[B]\[en]no-prompt\f[R]
90 This option is a no-op.
91 .RS
92 .PP
93 This is a \f[B]non-portable extension\f[R].
94 .RE
95 .TP
96 \f[B]-x\f[R] \f[B]\[en]extended-register\f[R]
97 Enables extended register mode.
98 See the \f[I]Extended Register Mode\f[R] subsection of the
99 \f[B]REGISTERS\f[R] section for more information.
100 .RS
101 .PP
102 This is a \f[B]non-portable extension\f[R].
103 .RE
104 .TP
105 \f[B]-e\f[R] \f[I]expr\f[R], \f[B]\[en]expression\f[R]=\f[I]expr\f[R]
106 Evaluates \f[I]expr\f[R].
107 If multiple expressions are given, they are evaluated in order.
108 If files are given as well (see below), the expressions and files are
109 evaluated in the order given.
110 This means that if a file is given before an expression, the file is
111 read in and evaluated first.
112 .RS
113 .PP
114 If this option is given on the command-line (i.e., not in
115 \f[B]DC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
116 then after processing all expressions and files, dc(1) will exit, unless
117 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
118 \f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
119 \f[B]DC_ENV_ARGS\f[R].
120 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
121 \f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
122 \f[B]-f-\f[R] or equivalent is given, dc(1) will give a fatal error and
123 exit.
124 .PP
125 This is a \f[B]non-portable extension\f[R].
126 .RE
127 .TP
128 \f[B]-f\f[R] \f[I]file\f[R], \f[B]\[en]file\f[R]=\f[I]file\f[R]
129 Reads in \f[I]file\f[R] and evaluates it, line by line, as though it
130 were read through \f[B]stdin\f[R].
131 If expressions are also given (see above), the expressions are evaluated
132 in the order given.
133 .RS
134 .PP
135 If this option is given on the command-line (i.e., not in
136 \f[B]DC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
137 then after processing all expressions and files, dc(1) will exit, unless
138 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
139 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
140 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
141 \f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
142 \f[B]-f-\f[R] or equivalent is given, dc(1) will give a fatal error and
143 exit.
144 .PP
145 This is a \f[B]non-portable extension\f[R].
146 .RE
147 .PP
148 All long options are \f[B]non-portable extensions\f[R].
149 .SH STDOUT
150 .PP
151 Any non-error output is written to \f[B]stdout\f[R].
152 In addition, if history (see the \f[B]HISTORY\f[R] section) and the
153 prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
154 to \f[B]stdout\f[R].
155 .PP
156 \f[B]Note\f[R]: Unlike other dc(1) implementations, this dc(1) will
157 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
158 write to \f[B]stdout\f[R], so if \f[B]stdout\f[R] is closed, as in
159 \f[B]dc >&-\f[R], it will quit with an error.
160 This is done so that dc(1) can report problems when \f[B]stdout\f[R] is
161 redirected to a file.
162 .PP
163 If there are scripts that depend on the behavior of other dc(1)
164 implementations, it is recommended that those scripts be changed to
165 redirect \f[B]stdout\f[R] to \f[B]/dev/null\f[R].
166 .SH STDERR
167 .PP
168 Any error output is written to \f[B]stderr\f[R].
169 .PP
170 \f[B]Note\f[R]: Unlike other dc(1) implementations, this dc(1) will
171 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
172 write to \f[B]stderr\f[R], so if \f[B]stderr\f[R] is closed, as in
173 \f[B]dc 2>&-\f[R], it will quit with an error.
174 This is done so that dc(1) can exit with an error code when
175 \f[B]stderr\f[R] is redirected to a file.
176 .PP
177 If there are scripts that depend on the behavior of other dc(1)
178 implementations, it is recommended that those scripts be changed to
179 redirect \f[B]stderr\f[R] to \f[B]/dev/null\f[R].
180 .SH SYNTAX
181 .PP
182 Each item in the input source code, either a number (see the
183 \f[B]NUMBERS\f[R] section) or a command (see the \f[B]COMMANDS\f[R]
184 section), is processed and executed, in order.
185 Input is processed immediately when entered.
186 .PP
187 \f[B]ibase\f[R] is a register (see the \f[B]REGISTERS\f[R] section) that
188 determines how to interpret constant numbers.
189 It is the \[lq]input\[rq] base, or the number base used for interpreting
190 input numbers.
191 \f[B]ibase\f[R] is initially \f[B]10\f[R].
192 The max allowable value for \f[B]ibase\f[R] is \f[B]16\f[R].
193 The min allowable value for \f[B]ibase\f[R] is \f[B]2\f[R].
194 The max allowable value for \f[B]ibase\f[R] can be queried in dc(1)
195 programs with the \f[B]T\f[R] command.
196 .PP
197 \f[B]obase\f[R] is a register (see the \f[B]REGISTERS\f[R] section) that
198 determines how to output results.
199 It is the \[lq]output\[rq] base, or the number base used for outputting
200 numbers.
201 \f[B]obase\f[R] is initially \f[B]10\f[R].
202 The max allowable value for \f[B]obase\f[R] is \f[B]DC_BASE_MAX\f[R] and
203 can be queried with the \f[B]U\f[R] command.
204 The min allowable value for \f[B]obase\f[R] is \f[B]2\f[R].
205 Values are output in the specified base.
206 .PP
207 The \f[I]scale\f[R] of an expression is the number of digits in the
208 result of the expression right of the decimal point, and \f[B]scale\f[R]
209 is a register (see the \f[B]REGISTERS\f[R] section) that sets the
210 precision of any operations (with exceptions).
211 \f[B]scale\f[R] is initially \f[B]0\f[R].
212 \f[B]scale\f[R] cannot be negative.
213 The max allowable value for \f[B]scale\f[R] can be queried in dc(1)
214 programs with the \f[B]V\f[R] command.
215 .SS Comments
216 .PP
217 Comments go from \f[B]#\f[R] until, and not including, the next newline.
218 This is a \f[B]non-portable extension\f[R].
219 .SH NUMBERS
220 .PP
221 Numbers are strings made up of digits, uppercase letters up to
222 \f[B]F\f[R], and at most \f[B]1\f[R] period for a radix.
223 Numbers can have up to \f[B]DC_NUM_MAX\f[R] digits.
224 Uppercase letters are equal to \f[B]9\f[R] + their position in the
225 alphabet (i.e., \f[B]A\f[R] equals \f[B]10\f[R], or \f[B]9+1\f[R]).
226 If a digit or letter makes no sense with the current value of
227 \f[B]ibase\f[R], they are set to the value of the highest valid digit in
228 \f[B]ibase\f[R].
229 .PP
230 Single-character numbers (i.e., \f[B]A\f[R] alone) take the value that
231 they would have if they were valid digits, regardless of the value of
232 \f[B]ibase\f[R].
233 This means that \f[B]A\f[R] alone always equals decimal \f[B]10\f[R] and
234 \f[B]F\f[R] alone always equals decimal \f[B]15\f[R].
235 .SH COMMANDS
236 .PP
237 The valid commands are listed below.
238 .SS Printing
239 .PP
240 These commands are used for printing.
241 .TP
242 \f[B]p\f[R]
243 Prints the value on top of the stack, whether number or string, and
244 prints a newline after.
245 .RS
246 .PP
247 This does not alter the stack.
248 .RE
249 .TP
250 \f[B]n\f[R]
251 Prints the value on top of the stack, whether number or string, and pops
252 it off of the stack.
253 .TP
254 \f[B]P\f[R]
255 Pops a value off the stack.
256 .RS
257 .PP
258 If the value is a number, it is truncated and the absolute value of the
259 result is printed as though \f[B]obase\f[R] is \f[B]UCHAR_MAX+1\f[R] and
260 each digit is interpreted as an ASCII character, making it a byte
261 stream.
262 .PP
263 If the value is a string, it is printed without a trailing newline.
264 .PP
265 This is a \f[B]non-portable extension\f[R].
266 .RE
267 .TP
268 \f[B]f\f[R]
269 Prints the entire contents of the stack, in order from newest to oldest,
270 without altering anything.
271 .RS
272 .PP
273 Users should use this command when they get lost.
274 .RE
275 .SS Arithmetic
276 .PP
277 These are the commands used for arithmetic.
278 .TP
279 \f[B]+\f[R]
280 The top two values are popped off the stack, added, and the result is
281 pushed onto the stack.
282 The \f[I]scale\f[R] of the result is equal to the max \f[I]scale\f[R] of
283 both operands.
284 .TP
285 \f[B]-\f[R]
286 The top two values are popped off the stack, subtracted, and the result
287 is pushed onto the stack.
288 The \f[I]scale\f[R] of the result is equal to the max \f[I]scale\f[R] of
289 both operands.
290 .TP
291 \f[B]*\f[R]
292 The top two values are popped off the stack, multiplied, and the result
293 is pushed onto the stack.
294 If \f[B]a\f[R] is the \f[I]scale\f[R] of the first expression and
295 \f[B]b\f[R] is the \f[I]scale\f[R] of the second expression, the
296 \f[I]scale\f[R] of the result is equal to
297 \f[B]min(a+b,max(scale,a,b))\f[R] where \f[B]min()\f[R] and
298 \f[B]max()\f[R] return the obvious values.
299 .TP
300 \f[B]/\f[R]
301 The top two values are popped off the stack, divided, and the result is
302 pushed onto the stack.
303 The \f[I]scale\f[R] of the result is equal to \f[B]scale\f[R].
304 .RS
305 .PP
306 The first value popped off of the stack must be non-zero.
307 .RE
308 .TP
309 \f[B]%\f[R]
310 The top two values are popped off the stack, remaindered, and the result
311 is pushed onto the stack.
312 .RS
313 .PP
314 Remaindering is equivalent to 1) Computing \f[B]a/b\f[R] to current
315 \f[B]scale\f[R], and 2) Using the result of step 1 to calculate
316 \f[B]a-(a/b)*b\f[R] to \f[I]scale\f[R]
317 \f[B]max(scale+scale(b),scale(a))\f[R].
318 .PP
319 The first value popped off of the stack must be non-zero.
320 .RE
321 .TP
322 \f[B]\[ti]\f[R]
323 The top two values are popped off the stack, divided and remaindered,
324 and the results (divided first, remainder second) are pushed onto the
325 stack.
326 This is equivalent to \f[B]x y / x y %\f[R] except that \f[B]x\f[R] and
327 \f[B]y\f[R] are only evaluated once.
328 .RS
329 .PP
330 The first value popped off of the stack must be non-zero.
331 .PP
332 This is a \f[B]non-portable extension\f[R].
333 .RE
334 .TP
335 \f[B]\[ha]\f[R]
336 The top two values are popped off the stack, the second is raised to the
337 power of the first, and the result is pushed onto the stack.
338 The \f[I]scale\f[R] of the result is equal to \f[B]scale\f[R].
339 .RS
340 .PP
341 The first value popped off of the stack must be an integer, and if that
342 value is negative, the second value popped off of the stack must be
343 non-zero.
344 .RE
345 .TP
346 \f[B]v\f[R]
347 The top value is popped off the stack, its square root is computed, and
348 the result is pushed onto the stack.
349 The \f[I]scale\f[R] of the result is equal to \f[B]scale\f[R].
350 .RS
351 .PP
352 The value popped off of the stack must be non-negative.
353 .RE
354 .TP
355 \f[B]_\f[R]
356 If this command \f[I]immediately\f[R] precedes a number (i.e., no spaces
357 or other commands), then that number is input as a negative number.
358 .RS
359 .PP
360 Otherwise, the top value on the stack is popped and copied, and the copy
361 is negated and pushed onto the stack.
362 This behavior without a number is a \f[B]non-portable extension\f[R].
363 .RE
364 .TP
365 \f[B]b\f[R]
366 The top value is popped off the stack, and if it is zero, it is pushed
367 back onto the stack.
368 Otherwise, its absolute value is pushed onto the stack.
369 .RS
370 .PP
371 This is a \f[B]non-portable extension\f[R].
372 .RE
373 .TP
374 \f[B]|\f[R]
375 The top three values are popped off the stack, a modular exponentiation
376 is computed, and the result is pushed onto the stack.
377 .RS
378 .PP
379 The first value popped is used as the reduction modulus and must be an
380 integer and non-zero.
381 The second value popped is used as the exponent and must be an integer
382 and non-negative.
383 The third value popped is the base and must be an integer.
384 .PP
385 This is a \f[B]non-portable extension\f[R].
386 .RE
387 .TP
388 \f[B]G\f[R]
389 The top two values are popped off of the stack, they are compared, and a
390 \f[B]1\f[R] is pushed if they are equal, or \f[B]0\f[R] otherwise.
391 .RS
392 .PP
393 This is a \f[B]non-portable extension\f[R].
394 .RE
395 .TP
396 \f[B]N\f[R]
397 The top value is popped off of the stack, and if it a \f[B]0\f[R], a
398 \f[B]1\f[R] is pushed; otherwise, a \f[B]0\f[R] is pushed.
399 .RS
400 .PP
401 This is a \f[B]non-portable extension\f[R].
402 .RE
403 .TP
404 \f[B](\f[R]
405 The top two values are popped off of the stack, they are compared, and a
406 \f[B]1\f[R] is pushed if the first is less than the second, or
407 \f[B]0\f[R] otherwise.
408 .RS
409 .PP
410 This is a \f[B]non-portable extension\f[R].
411 .RE
412 .TP
413 \f[B]{\f[R]
414 The top two values are popped off of the stack, they are compared, and a
415 \f[B]1\f[R] is pushed if the first is less than or equal to the second,
416 or \f[B]0\f[R] otherwise.
417 .RS
418 .PP
419 This is a \f[B]non-portable extension\f[R].
420 .RE
421 .TP
422 \f[B])\f[R]
423 The top two values are popped off of the stack, they are compared, and a
424 \f[B]1\f[R] is pushed if the first is greater than the second, or
425 \f[B]0\f[R] otherwise.
426 .RS
427 .PP
428 This is a \f[B]non-portable extension\f[R].
429 .RE
430 .TP
431 \f[B]}\f[R]
432 The top two values are popped off of the stack, they are compared, and a
433 \f[B]1\f[R] is pushed if the first is greater than or equal to the
434 second, or \f[B]0\f[R] otherwise.
435 .RS
436 .PP
437 This is a \f[B]non-portable extension\f[R].
438 .RE
439 .TP
440 \f[B]M\f[R]
441 The top two values are popped off of the stack.
442 If they are both non-zero, a \f[B]1\f[R] is pushed onto the stack.
443 If either of them is zero, or both of them are, then a \f[B]0\f[R] is
444 pushed onto the stack.
445 .RS
446 .PP
447 This is like the \f[B]&&\f[R] operator in bc(1), and it is \f[I]not\f[R]
448 a short-circuit operator.
449 .PP
450 This is a \f[B]non-portable extension\f[R].
451 .RE
452 .TP
453 \f[B]m\f[R]
454 The top two values are popped off of the stack.
455 If at least one of them is non-zero, a \f[B]1\f[R] is pushed onto the
456 stack.
457 If both of them are zero, then a \f[B]0\f[R] is pushed onto the stack.
458 .RS
459 .PP
460 This is like the \f[B]||\f[R] operator in bc(1), and it is \f[I]not\f[R]
461 a short-circuit operator.
462 .PP
463 This is a \f[B]non-portable extension\f[R].
464 .RE
465 .SS Stack Control
466 .PP
467 These commands control the stack.
468 .TP
469 \f[B]c\f[R]
470 Removes all items from (\[lq]clears\[rq]) the stack.
471 .TP
472 \f[B]d\f[R]
473 Copies the item on top of the stack (\[lq]duplicates\[rq]) and pushes
474 the copy onto the stack.
475 .TP
476 \f[B]r\f[R]
477 Swaps (\[lq]reverses\[rq]) the two top items on the stack.
478 .TP
479 \f[B]R\f[R]
480 Pops (\[lq]removes\[rq]) the top value from the stack.
481 .SS Register Control
482 .PP
483 These commands control registers (see the \f[B]REGISTERS\f[R] section).
484 .TP
485 \f[B]s\f[R]\f[I]r\f[R]
486 Pops the value off the top of the stack and stores it into register
487 \f[I]r\f[R].
488 .TP
489 \f[B]l\f[R]\f[I]r\f[R]
490 Copies the value in register \f[I]r\f[R] and pushes it onto the stack.
491 This does not alter the contents of \f[I]r\f[R].
492 .TP
493 \f[B]S\f[R]\f[I]r\f[R]
494 Pops the value off the top of the (main) stack and pushes it onto the
495 stack of register \f[I]r\f[R].
496 The previous value of the register becomes inaccessible.
497 .TP
498 \f[B]L\f[R]\f[I]r\f[R]
499 Pops the value off the top of the stack for register \f[I]r\f[R] and
500 push it onto the main stack.
501 The previous value in the stack for register \f[I]r\f[R], if any, is now
502 accessible via the \f[B]l\f[R]\f[I]r\f[R] command.
503 .SS Parameters
504 .PP
505 These commands control the values of \f[B]ibase\f[R], \f[B]obase\f[R],
506 and \f[B]scale\f[R].
507 Also see the \f[B]SYNTAX\f[R] section.
508 .TP
509 \f[B]i\f[R]
510 Pops the value off of the top of the stack and uses it to set
511 \f[B]ibase\f[R], which must be between \f[B]2\f[R] and \f[B]16\f[R],
512 inclusive.
513 .RS
514 .PP
515 If the value on top of the stack has any \f[I]scale\f[R], the
516 \f[I]scale\f[R] is ignored.
517 .RE
518 .TP
519 \f[B]o\f[R]
520 Pops the value off of the top of the stack and uses it to set
521 \f[B]obase\f[R], which must be between \f[B]2\f[R] and
522 \f[B]DC_BASE_MAX\f[R], inclusive (see the \f[B]LIMITS\f[R] section).
523 .RS
524 .PP
525 If the value on top of the stack has any \f[I]scale\f[R], the
526 \f[I]scale\f[R] is ignored.
527 .RE
528 .TP
529 \f[B]k\f[R]
530 Pops the value off of the top of the stack and uses it to set
531 \f[B]scale\f[R], which must be non-negative.
532 .RS
533 .PP
534 If the value on top of the stack has any \f[I]scale\f[R], the
535 \f[I]scale\f[R] is ignored.
536 .RE
537 .TP
538 \f[B]I\f[R]
539 Pushes the current value of \f[B]ibase\f[R] onto the main stack.
540 .TP
541 \f[B]O\f[R]
542 Pushes the current value of \f[B]obase\f[R] onto the main stack.
543 .TP
544 \f[B]K\f[R]
545 Pushes the current value of \f[B]scale\f[R] onto the main stack.
546 .TP
547 \f[B]T\f[R]
548 Pushes the maximum allowable value of \f[B]ibase\f[R] onto the main
549 stack.
550 .RS
551 .PP
552 This is a \f[B]non-portable extension\f[R].
553 .RE
554 .TP
555 \f[B]U\f[R]
556 Pushes the maximum allowable value of \f[B]obase\f[R] onto the main
557 stack.
558 .RS
559 .PP
560 This is a \f[B]non-portable extension\f[R].
561 .RE
562 .TP
563 \f[B]V\f[R]
564 Pushes the maximum allowable value of \f[B]scale\f[R] onto the main
565 stack.
566 .RS
567 .PP
568 This is a \f[B]non-portable extension\f[R].
569 .RE
570 .SS Strings
571 .PP
572 The following commands control strings.
573 .PP
574 dc(1) can work with both numbers and strings, and registers (see the
575 \f[B]REGISTERS\f[R] section) can hold both strings and numbers.
576 dc(1) always knows whether the contents of a register are a string or a
577 number.
578 .PP
579 While arithmetic operations have to have numbers, and will print an
580 error if given a string, other commands accept strings.
581 .PP
582 Strings can also be executed as macros.
583 For example, if the string \f[B][1pR]\f[R] is executed as a macro, then
584 the code \f[B]1pR\f[R] is executed, meaning that the \f[B]1\f[R] will be
585 printed with a newline after and then popped from the stack.
586 .TP
587 \f[B][\f[R]_characters_\f[B]]\f[R]
588 Makes a string containing \f[I]characters\f[R] and pushes it onto the
589 stack.
590 .RS
591 .PP
592 If there are brackets (\f[B][\f[R] and \f[B]]\f[R]) in the string, then
593 they must be balanced.
594 Unbalanced brackets can be escaped using a backslash (\f[B]\[rs]\f[R])
595 character.
596 .PP
597 If there is a backslash character in the string, the character after it
598 (even another backslash) is put into the string verbatim, but the
599 (first) backslash is not.
600 .RE
601 .TP
602 \f[B]a\f[R]
603 The value on top of the stack is popped.
604 .RS
605 .PP
606 If it is a number, it is truncated and its absolute value is taken.
607 The result mod \f[B]UCHAR_MAX+1\f[R] is calculated.
608 If that result is \f[B]0\f[R], push an empty string; otherwise, push a
609 one-character string where the character is the result of the mod
610 interpreted as an ASCII character.
611 .PP
612 If it is a string, then a new string is made.
613 If the original string is empty, the new string is empty.
614 If it is not, then the first character of the original string is used to
615 create the new string as a one-character string.
616 The new string is then pushed onto the stack.
617 .PP
618 This is a \f[B]non-portable extension\f[R].
619 .RE
620 .TP
621 \f[B]x\f[R]
622 Pops a value off of the top of the stack.
623 .RS
624 .PP
625 If it is a number, it is pushed back onto the stack.
626 .PP
627 If it is a string, it is executed as a macro.
628 .PP
629 This behavior is the norm whenever a macro is executed, whether by this
630 command or by the conditional execution commands below.
631 .RE
632 .TP
633 \f[B]>\f[R]\f[I]r\f[R]
634 Pops two values off of the stack that must be numbers and compares them.
635 If the first value is greater than the second, then the contents of
636 register \f[I]r\f[R] are executed.
637 .RS
638 .PP
639 For example, \f[B]0 1>a\f[R] will execute the contents of register
640 \f[B]a\f[R], and \f[B]1 0>a\f[R] will not.
641 .PP
642 If either or both of the values are not numbers, dc(1) will raise an
643 error and reset (see the \f[B]RESET\f[R] section).
644 .RE
645 .TP
646 \f[B]>\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
647 Like the above, but will execute register \f[I]s\f[R] if the comparison
648 fails.
649 .RS
650 .PP
651 If either or both of the values are not numbers, dc(1) will raise an
652 error and reset (see the \f[B]RESET\f[R] section).
653 .PP
654 This is a \f[B]non-portable extension\f[R].
655 .RE
656 .TP
657 \f[B]!>\f[R]\f[I]r\f[R]
658 Pops two values off of the stack that must be numbers and compares them.
659 If the first value is not greater than the second (less than or equal
660 to), then the contents of register \f[I]r\f[R] are executed.
661 .RS
662 .PP
663 If either or both of the values are not numbers, dc(1) will raise an
664 error and reset (see the \f[B]RESET\f[R] section).
665 .RE
666 .TP
667 \f[B]!>\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
668 Like the above, but will execute register \f[I]s\f[R] if the comparison
669 fails.
670 .RS
671 .PP
672 If either or both of the values are not numbers, dc(1) will raise an
673 error and reset (see the \f[B]RESET\f[R] section).
674 .PP
675 This is a \f[B]non-portable extension\f[R].
676 .RE
677 .TP
678 \f[B]<\f[R]\f[I]r\f[R]
679 Pops two values off of the stack that must be numbers and compares them.
680 If the first value is less than the second, then the contents of
681 register \f[I]r\f[R] are executed.
682 .RS
683 .PP
684 If either or both of the values are not numbers, dc(1) will raise an
685 error and reset (see the \f[B]RESET\f[R] section).
686 .RE
687 .TP
688 \f[B]<\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
689 Like the above, but will execute register \f[I]s\f[R] if the comparison
690 fails.
691 .RS
692 .PP
693 If either or both of the values are not numbers, dc(1) will raise an
694 error and reset (see the \f[B]RESET\f[R] section).
695 .PP
696 This is a \f[B]non-portable extension\f[R].
697 .RE
698 .TP
699 \f[B]!<\f[R]\f[I]r\f[R]
700 Pops two values off of the stack that must be numbers and compares them.
701 If the first value is not less than the second (greater than or equal
702 to), then the contents of register \f[I]r\f[R] are executed.
703 .RS
704 .PP
705 If either or both of the values are not numbers, dc(1) will raise an
706 error and reset (see the \f[B]RESET\f[R] section).
707 .RE
708 .TP
709 \f[B]!<\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
710 Like the above, but will execute register \f[I]s\f[R] if the comparison
711 fails.
712 .RS
713 .PP
714 If either or both of the values are not numbers, dc(1) will raise an
715 error and reset (see the \f[B]RESET\f[R] section).
716 .PP
717 This is a \f[B]non-portable extension\f[R].
718 .RE
719 .TP
720 \f[B]=\f[R]\f[I]r\f[R]
721 Pops two values off of the stack that must be numbers and compares them.
722 If the first value is equal to the second, then the contents of register
723 \f[I]r\f[R] are executed.
724 .RS
725 .PP
726 If either or both of the values are not numbers, dc(1) will raise an
727 error and reset (see the \f[B]RESET\f[R] section).
728 .RE
729 .TP
730 \f[B]=\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
731 Like the above, but will execute register \f[I]s\f[R] if the comparison
732 fails.
733 .RS
734 .PP
735 If either or both of the values are not numbers, dc(1) will raise an
736 error and reset (see the \f[B]RESET\f[R] section).
737 .PP
738 This is a \f[B]non-portable extension\f[R].
739 .RE
740 .TP
741 \f[B]!=\f[R]\f[I]r\f[R]
742 Pops two values off of the stack that must be numbers and compares them.
743 If the first value is not equal to the second, then the contents of
744 register \f[I]r\f[R] are executed.
745 .RS
746 .PP
747 If either or both of the values are not numbers, dc(1) will raise an
748 error and reset (see the \f[B]RESET\f[R] section).
749 .RE
750 .TP
751 \f[B]!=\f[R]\f[I]r\f[R]\f[B]e\f[R]\f[I]s\f[R]
752 Like the above, but will execute register \f[I]s\f[R] if the comparison
753 fails.
754 .RS
755 .PP
756 If either or both of the values are not numbers, dc(1) will raise an
757 error and reset (see the \f[B]RESET\f[R] section).
758 .PP
759 This is a \f[B]non-portable extension\f[R].
760 .RE
761 .TP
762 \f[B]?\f[R]
763 Reads a line from the \f[B]stdin\f[R] and executes it.
764 This is to allow macros to request input from users.
765 .TP
766 \f[B]q\f[R]
767 During execution of a macro, this exits the execution of that macro and
768 the execution of the macro that executed it.
769 If there are no macros, or only one macro executing, dc(1) exits.
770 .TP
771 \f[B]Q\f[R]
772 Pops a value from the stack which must be non-negative and is used the
773 number of macro executions to pop off of the execution stack.
774 If the number of levels to pop is greater than the number of executing
775 macros, dc(1) exits.
776 .SS Status
777 .PP
778 These commands query status of the stack or its top value.
779 .TP
780 \f[B]Z\f[R]
781 Pops a value off of the stack.
782 .RS
783 .PP
784 If it is a number, calculates the number of significant decimal digits
785 it has and pushes the result.
786 .PP
787 If it is a string, pushes the number of characters the string has.
788 .RE
789 .TP
790 \f[B]X\f[R]
791 Pops a value off of the stack.
792 .RS
793 .PP
794 If it is a number, pushes the \f[I]scale\f[R] of the value onto the
795 stack.
796 .PP
797 If it is a string, pushes \f[B]0\f[R].
798 .RE
799 .TP
800 \f[B]z\f[R]
801 Pushes the current stack depth (before execution of this command).
802 .SS Arrays
803 .PP
804 These commands manipulate arrays.
805 .TP
806 \f[B]:\f[R]\f[I]r\f[R]
807 Pops the top two values off of the stack.
808 The second value will be stored in the array \f[I]r\f[R] (see the
809 \f[B]REGISTERS\f[R] section), indexed by the first value.
810 .TP
811 \f[B];\f[R]\f[I]r\f[R]
812 Pops the value on top of the stack and uses it as an index into the
813 array \f[I]r\f[R].
814 The selected value is then pushed onto the stack.
815 .SH REGISTERS
816 .PP
817 Registers are names that can store strings, numbers, and arrays.
818 (Number/string registers do not interfere with array registers.)
819 .PP
820 Each register is also its own stack, so the current register value is
821 the top of the stack for the register.
822 All registers, when first referenced, have one value (\f[B]0\f[R]) in
823 their stack.
824 .PP
825 In non-extended register mode, a register name is just the single
826 character that follows any command that needs a register name.
827 The only exception is a newline (\f[B]`\[rs]n'\f[R]); it is a parse
828 error for a newline to be used as a register name.
829 .SS Extended Register Mode
830 .PP
831 Unlike most other dc(1) implentations, this dc(1) provides nearly
832 unlimited amounts of registers, if extended register mode is enabled.
833 .PP
834 If extended register mode is enabled (\f[B]-x\f[R] or
835 \f[B]\[en]extended-register\f[R] command-line arguments are given), then
836 normal single character registers are used \f[I]unless\f[R] the
837 character immediately following a command that needs a register name is
838 a space (according to \f[B]isspace()\f[R]) and not a newline
839 (\f[B]`\[rs]n'\f[R]).
840 .PP
841 In that case, the register name is found according to the regex
842 \f[B][a-z][a-z0-9_]*\f[R] (like bc(1) identifiers), and it is a parse
843 error if the next non-space characters do not match that regex.
844 .SH RESET
845 .PP
846 When dc(1) encounters an error or a signal that it has a non-default
847 handler for, it resets.
848 This means that several things happen.
849 .PP
850 First, any macros that are executing are stopped and popped off the
851 stack.
852 The behavior is not unlike that of exceptions in programming languages.
853 Then the execution point is set so that any code waiting to execute
854 (after all macros returned) is skipped.
855 .PP
856 Thus, when dc(1) resets, it skips any remaining code waiting to be
857 executed.
858 Then, if it is interactive mode, and the error was not a fatal error
859 (see the \f[B]EXIT STATUS\f[R] section), it asks for more input;
860 otherwise, it exits with the appropriate return code.
861 .SH PERFORMANCE
862 .PP
863 Most dc(1) implementations use \f[B]char\f[R] types to calculate the
864 value of \f[B]1\f[R] decimal digit at a time, but that can be slow.
865 This dc(1) does something different.
866 .PP
867 It uses large integers to calculate more than \f[B]1\f[R] decimal digit
868 at a time.
869 If built in a environment where \f[B]DC_LONG_BIT\f[R] (see the
870 \f[B]LIMITS\f[R] section) is \f[B]64\f[R], then each integer has
871 \f[B]9\f[R] decimal digits.
872 If built in an environment where \f[B]DC_LONG_BIT\f[R] is \f[B]32\f[R]
873 then each integer has \f[B]4\f[R] decimal digits.
874 This value (the number of decimal digits per large integer) is called
875 \f[B]DC_BASE_DIGS\f[R].
876 .PP
877 In addition, this dc(1) uses an even larger integer for overflow
878 checking.
879 This integer type depends on the value of \f[B]DC_LONG_BIT\f[R], but is
880 always at least twice as large as the integer type used to store digits.
881 .SH LIMITS
882 .PP
883 The following are the limits on dc(1):
884 .TP
885 \f[B]DC_LONG_BIT\f[R]
886 The number of bits in the \f[B]long\f[R] type in the environment where
887 dc(1) was built.
888 This determines how many decimal digits can be stored in a single large
889 integer (see the \f[B]PERFORMANCE\f[R] section).
890 .TP
891 \f[B]DC_BASE_DIGS\f[R]
892 The number of decimal digits per large integer (see the
893 \f[B]PERFORMANCE\f[R] section).
894 Depends on \f[B]DC_LONG_BIT\f[R].
895 .TP
896 \f[B]DC_BASE_POW\f[R]
897 The max decimal number that each large integer can store (see
898 \f[B]DC_BASE_DIGS\f[R]) plus \f[B]1\f[R].
899 Depends on \f[B]DC_BASE_DIGS\f[R].
900 .TP
901 \f[B]DC_OVERFLOW_MAX\f[R]
902 The max number that the overflow type (see the \f[B]PERFORMANCE\f[R]
903 section) can hold.
904 Depends on \f[B]DC_LONG_BIT\f[R].
905 .TP
906 \f[B]DC_BASE_MAX\f[R]
907 The maximum output base.
908 Set at \f[B]DC_BASE_POW\f[R].
909 .TP
910 \f[B]DC_DIM_MAX\f[R]
911 The maximum size of arrays.
912 Set at \f[B]SIZE_MAX-1\f[R].
913 .TP
914 \f[B]DC_SCALE_MAX\f[R]
915 The maximum \f[B]scale\f[R].
916 Set at \f[B]DC_OVERFLOW_MAX-1\f[R].
917 .TP
918 \f[B]DC_STRING_MAX\f[R]
919 The maximum length of strings.
920 Set at \f[B]DC_OVERFLOW_MAX-1\f[R].
921 .TP
922 \f[B]DC_NAME_MAX\f[R]
923 The maximum length of identifiers.
924 Set at \f[B]DC_OVERFLOW_MAX-1\f[R].
925 .TP
926 \f[B]DC_NUM_MAX\f[R]
927 The maximum length of a number (in decimal digits), which includes
928 digits after the decimal point.
929 Set at \f[B]DC_OVERFLOW_MAX-1\f[R].
930 .TP
931 Exponent
932 The maximum allowable exponent (positive or negative).
933 Set at \f[B]DC_OVERFLOW_MAX\f[R].
934 .TP
935 Number of vars
936 The maximum number of vars/arrays.
937 Set at \f[B]SIZE_MAX-1\f[R].
938 .PP
939 These limits are meant to be effectively non-existent; the limits are so
940 large (at least on 64-bit machines) that there should not be any point
941 at which they become a problem.
942 In fact, memory should be exhausted before these limits should be hit.
943 .SH ENVIRONMENT VARIABLES
944 .PP
945 dc(1) recognizes the following environment variables:
946 .TP
947 \f[B]DC_ENV_ARGS\f[R]
948 This is another way to give command-line arguments to dc(1).
949 They should be in the same format as all other command-line arguments.
950 These are always processed first, so any files given in
951 \f[B]DC_ENV_ARGS\f[R] will be processed before arguments and files given
952 on the command-line.
953 This gives the user the ability to set up \[lq]standard\[rq] options and
954 files to be used at every invocation.
955 The most useful thing for such files to contain would be useful
956 functions that the user might want every time dc(1) runs.
957 Another use would be to use the \f[B]-e\f[R] option to set
958 \f[B]scale\f[R] to a value other than \f[B]0\f[R].
959 .RS
960 .PP
961 The code that parses \f[B]DC_ENV_ARGS\f[R] will correctly handle quoted
962 arguments, but it does not understand escape sequences.
963 For example, the string \f[B]\[lq]/home/gavin/some dc file.dc\[rq]\f[R]
964 will be correctly parsed, but the string \f[B]\[lq]/home/gavin/some
965 \[dq]dc\[dq] file.dc\[rq]\f[R] will include the backslashes.
966 .PP
967 The quote parsing will handle either kind of quotes, \f[B]\[cq]\f[R] or
968 \f[B]\[lq]\f[R]. Thus, if you have a file with any number of single
969 quotes in the name, you can use double quotes as the outside quotes, as
970 in \f[B]\[rq]some `dc' file.dc\[dq]\f[R], and vice versa if you have a
971 file with double quotes.
972 However, handling a file with both kinds of quotes in
973 \f[B]DC_ENV_ARGS\f[R] is not supported due to the complexity of the
974 parsing, though such files are still supported on the command-line where
975 the parsing is done by the shell.
976 .RE
977 .TP
978 \f[B]DC_LINE_LENGTH\f[R]
979 If this environment variable exists and contains an integer that is
980 greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
981 (\f[B]2\[ha]16-1\f[R]), dc(1) will output lines to that length,
982 including the backslash newline combo.
983 The default line length is \f[B]70\f[R].
984 .TP
985 \f[B]DC_EXPR_EXIT\f[R]
986 If this variable exists (no matter the contents), dc(1) will exit
987 immediately after executing expressions and files given by the
988 \f[B]-e\f[R] and/or \f[B]-f\f[R] command-line options (and any
989 equivalents).
990 .SH EXIT STATUS
991 .PP
992 dc(1) returns the following exit statuses:
993 .TP
994 \f[B]0\f[R]
995 No error.
996 .TP
997 \f[B]1\f[R]
998 A math error occurred.
999 This follows standard practice of using \f[B]1\f[R] for expected errors,
1000 since math errors will happen in the process of normal execution.
1001 .RS
1002 .PP
1003 Math errors include divide by \f[B]0\f[R], taking the square root of a
1004 negative number, attempting to convert a negative number to a hardware
1005 integer, overflow when converting a number to a hardware integer, and
1006 attempting to use a non-integer where an integer is required.
1007 .PP
1008 Converting to a hardware integer happens for the second operand of the
1009 power (\f[B]\[ha]\f[R]) operator.
1010 .RE
1011 .TP
1012 \f[B]2\f[R]
1013 A parse error occurred.
1014 .RS
1015 .PP
1016 Parse errors include unexpected \f[B]EOF\f[R], using an invalid
1017 character, failing to find the end of a string or comment, and using a
1018 token where it is invalid.
1019 .RE
1020 .TP
1021 \f[B]3\f[R]
1022 A runtime error occurred.
1023 .RS
1024 .PP
1025 Runtime errors include assigning an invalid number to \f[B]ibase\f[R],
1026 \f[B]obase\f[R], or \f[B]scale\f[R]; give a bad expression to a
1027 \f[B]read()\f[R] call, calling \f[B]read()\f[R] inside of a
1028 \f[B]read()\f[R] call, type errors, and attempting an operation when the
1029 stack has too few elements.
1030 .RE
1031 .TP
1032 \f[B]4\f[R]
1033 A fatal error occurred.
1034 .RS
1035 .PP
1036 Fatal errors include memory allocation errors, I/O errors, failing to
1037 open files, attempting to use files that do not have only ASCII
1038 characters (dc(1) only accepts ASCII characters), attempting to open a
1039 directory as a file, and giving invalid command-line options.
1040 .RE
1041 .PP
1042 The exit status \f[B]4\f[R] is special; when a fatal error occurs, dc(1)
1043 always exits and returns \f[B]4\f[R], no matter what mode dc(1) is in.
1044 .PP
1045 The other statuses will only be returned when dc(1) is not in
1046 interactive mode (see the \f[B]INTERACTIVE MODE\f[R] section), since
1047 dc(1) resets its state (see the \f[B]RESET\f[R] section) and accepts
1048 more input when one of those errors occurs in interactive mode.
1049 This is also the case when interactive mode is forced by the
1050 \f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option.
1051 .PP
1052 These exit statuses allow dc(1) to be used in shell scripting with error
1053 checking, and its normal behavior can be forced by using the
1054 \f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option.
1055 .SH INTERACTIVE MODE
1056 .PP
1057 Like bc(1), dc(1) has an interactive mode and a non-interactive mode.
1058 Interactive mode is turned on automatically when both \f[B]stdin\f[R]
1059 and \f[B]stdout\f[R] are hooked to a terminal, but the \f[B]-i\f[R] flag
1060 and \f[B]\[en]interactive\f[R] option can turn it on in other cases.
1061 .PP
1062 In interactive mode, dc(1) attempts to recover from errors (see the
1063 \f[B]RESET\f[R] section), and in normal execution, flushes
1064 \f[B]stdout\f[R] as soon as execution is done for the current input.
1065 .SH TTY MODE
1066 .PP
1067 If \f[B]stdin\f[R], \f[B]stdout\f[R], and \f[B]stderr\f[R] are all
1068 connected to a TTY, dc(1) turns on \[lq]TTY mode.\[rq]
1069 .PP
1070 TTY mode is different from interactive mode because interactive mode is
1071 required in the bc(1)
1072 specification (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html),
1073 and interactive mode requires only \f[B]stdin\f[R] and \f[B]stdout\f[R]
1074 to be connected to a terminal.
1075 .SH SIGNAL HANDLING
1076 .PP
1077 Sending a \f[B]SIGINT\f[R] will cause dc(1) to stop execution of the
1078 current input.
1079 If dc(1) is in TTY mode (see the \f[B]TTY MODE\f[R] section), it will
1080 reset (see the \f[B]RESET\f[R] section).
1081 Otherwise, it will clean up and exit.
1082 .PP
1083 Note that \[lq]current input\[rq] can mean one of two things.
1084 If dc(1) is processing input from \f[B]stdin\f[R] in TTY mode, it will
1085 ask for more input.
1086 If dc(1) is processing input from a file in TTY mode, it will stop
1087 processing the file and start processing the next file, if one exists,
1088 or ask for input from \f[B]stdin\f[R] if no other file exists.
1089 .PP
1090 This means that if a \f[B]SIGINT\f[R] is sent to dc(1) as it is
1091 executing a file, it can seem as though dc(1) did not respond to the
1092 signal since it will immediately start executing the next file.
1093 This is by design; most files that users execute when interacting with
1094 dc(1) have function definitions, which are quick to parse.
1095 If a file takes a long time to execute, there may be a bug in that file.
1096 The rest of the files could still be executed without problem, allowing
1097 the user to continue.
1098 .PP
1099 \f[B]SIGTERM\f[R] and \f[B]SIGQUIT\f[R] cause dc(1) to clean up and
1100 exit, and it uses the default handler for all other signals.
1101 .SH SEE ALSO
1102 .PP
1103 bc(1)
1104 .SH STANDARDS
1105 .PP
1106 The dc(1) utility operators are compliant with the operators in the
1107 bc(1) IEEE Std 1003.1-2017
1108 (\[lq]POSIX.1-2017\[rq]) (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html)
1109 specification.
1110 .SH BUGS
1111 .PP
1112 None are known.
1113 Report bugs at https://git.yzena.com/gavin/bc.
1114 .SH AUTHOR
1115 .PP
1116 Gavin D.
1117 Howard <gavin@yzena.com> and contributors.