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 an
104 removes it, and prints it.
107 Print the values on the stack.
115 If executing a string, the recursion level is
119 the top value on the stack is popped and the string execution level is popped
123 Treat the top element of the stack as a character string
124 and execute it as a string of
129 Replace the number on the top of the stack with its scale factor.
134 string on the top of the stack.
144 top two elements of the stack.
147 is executed if they obey the stated
151 Replace the top element on the stack by its square root.
152 Any existing fractional part of the argument is taken
153 into account, but otherwise the scale factor is ignored.
156 Interpret the rest of the line as a shell command.
162 The top value on the stack is popped and used as the
163 number base for further input.
166 Push the input base on the top of the stack.
169 The top value on the stack is popped and used as the
170 number base for further output.
171 In bases larger than 10, each `digit' prints as a group of decimal digits.
174 Push the output base on the top of the stack.
177 Pop the top of the stack, and use that value as
178 a non-negative scale factor:
179 the appropriate number of places
180 are printed on output,
181 and maintained during multiplication, division, and exponentiation.
182 The interaction of scale factor,
183 input base, and output base will be reasonable if all are changed
187 Push the stack level onto the stack.
190 Replace the number on the top of the stack with its length.
193 A line of input is taken from the input source (usually the terminal)
199 for array operations.
201 The scale factor set by
203 determines how many digits are kept to the right of
207 is the current scale factor,
209 is the scale of the first operand,
211 is the scale of the second,
214 is the (integer) second operand,
215 results are truncated to the following scales.
218 \fL+\fR,\fL-\fR max(\fIsa,sb\fR)
219 \fL*\fR min(\fIsa\fR+\fIsb \fR, max\fR(\fIs,sa,sb\fR))
221 \fL%\fR so that dividend = divisor*quotient + remainder; remainder has sign of dividend
222 \fL^\fR min(\fIsa\fR\(mu|\fIb\fR|, max(\fIs,sa\fR))
223 \fLv\fR max(\fIs,sa\fR)
227 Print the first ten values of
242 .LR "is unimplemented" ,
245 is an octal number: an internal error.
248 for too many numbers being kept around.
251 for too many levels of nested execution.
253 When the input base exceeds 16,
254 there is no notation for digits greater than