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