11 is an arbitrary precision desk calculator.
12 Ordinarily it operates on decimal integers,
13 but one may specify an input base, output base,
14 and a number of fractional digits to be maintained.
15 The overall structure of
18 a stacking (reverse Polish) calculator.
19 If an argument is given,
20 input is taken from that file until its end,
21 then from the standard input.
22 The following constructions are recognized:
25 The value of the number is pushed on the stack.
26 A number is an unbroken string of the digits
30 A hexadecimal number beginning with a lower case
31 letter must be preceded by a zero to distinguish it
32 from the command associated with the letter.
33 It may be preceded by an underscore
37 Numbers may contain decimal points.
53 the top two values on the stack.
54 The two entries are popped off the stack;
55 the result is pushed on the stack in their place.
56 Any fractional part of an exponent is ignored.
63 Pop the top of the stack and store into
73 is treated as a stack and the value is pushed on it.
80 Push the value in register
86 All registers start with zero value.
91 is treated as a stack and its top value is popped onto the main stack.
95 top value on the stack.
98 Print the top value on the stack.
99 The top value remains unchanged.
101 interprets the top of the stack as a text
103 removes it, and prints it.
106 Print the values on the stack.
114 If executing a string, the recursion level is
118 the top value on the stack is popped and the string execution level is popped
122 Treat the top element of the stack as a character string
123 and execute it as a string of
128 Replace the number on the top of the stack with its scale factor.
133 string on the top of the stack.
143 top two elements of the stack.
146 is executed if they obey the stated
150 Replace the top element on the stack by its square root.
151 Any existing fractional part of the argument is taken
152 into account, but otherwise the scale factor is ignored.
155 Interpret the rest of the line as a shell command.
161 The top value on the stack is popped and used as the
162 number base for further input.
165 Push the input base on the top of the stack.
168 The top value on the stack is popped and used as the
169 number base for further output.
170 In bases larger than 10, each `digit' prints as a group of decimal digits.
173 Push the output base on the top of the stack.
176 Pop the top of the stack, and use that value as
177 a non-negative scale factor:
178 the appropriate number of places
179 are printed on output,
180 and maintained during multiplication, division, and exponentiation.
181 The interaction of scale factor,
182 input base, and output base will be reasonable if all are changed
186 Push the stack level onto the stack.
189 Replace the number on the top of the stack with its length.
192 A line of input is taken from the input source (usually the terminal)
198 for array operations.
200 The scale factor set by
202 determines how many digits are kept to the right of
206 is the current scale factor,
208 is the scale of the first operand,
210 is the scale of the second,
213 is the (integer) second operand,
214 results are truncated to the following scales.
217 \fL+\fR,\fL-\fR max(\fIsa,sb\fR)
218 \fL*\fR min(\fIsa\fR+\fIsb \fR, max\fR(\fIs,sa,sb\fR))
220 \fL%\fR so that dividend = divisor*quotient + remainder; remainder has sign of dividend
221 \fL^\fR min(\fIsa\fR\(mu|\fIb\fR|, max(\fIs,sa\fR))
222 \fLv\fR max(\fIs,sa\fR)
226 Print the first ten values of
241 .LR "is unimplemented" ,
244 is an octal number: an internal error.
247 for too many numbers being kept around.
250 for too many levels of nested execution.
252 When the input base exceeds 16,
253 there is no notation for digits greater than