Lines Matching full:of

9 .\" 1. Redistributions of source code and documentation must retain the above
10 .\" copyright notice, this list of conditions and the following disclaimer.
12 .\" notice, this list of conditions and the following disclaimer in the
14 .\" 3. All advertising materials mentioning features or use of this software
18 .\" 4. Neither the name of Caldera International, Inc. nor the names of other
22 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
25 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 .\" POSSIBILITY OF SUCH DAMAGE.
57 The size of numbers that can be manipulated is limited
59 On typical implementations of
61 the size of numbers that
69 Editor's note: the description of the implementation details of DC in this
70 paper is only valid for the original version of DC.
71 The current version of DC uses a different approach.
78 in the form of an interactive desk calculator.
81 specify an input base, output base, and a number of fractional
85 programs written in the familiar style of higher-level
88 Some of the commands described below were designed
108 Any number of commands are permitted on a line.
116 The value of the number is pushed onto the main stack.
117 A number is an unbroken string of the digits 0-9
137 The result of a division is an integer truncated toward zero.
138 See the detailed description below for the treatment of
145 top of the main stack is popped and stored into
202 treats the top element of the stack as a character string,
204 executes it as a string of DC commands.
208 puts the bracketed character string onto the top of the stack.
226 top two elements of the stack are popped and compared.
238 The square root of an integer is truncated to an integer.
239 For the treatment of numbers with decimal points, see
244 interprets the rest of the line as a
259 If \fBi\fP is capitalized, the value of
261 No mechanism has been provided for the input of arbitrary
268 If \fBo\fP is capitalized, the value of the output
273 The top of the stack is popped, and that value is used as
275 that influences the number of decimal places
279 If \fBk\fP is capitalized, the value of the scale factor
284 The value of the stack level is pushed onto the stack.
288 A line of input is taken from the input source (usually the console)
293 Internal Representation of Numbers
296 Numbers are kept in the form of a string
300 beginning of the string.
301 For example, the representation of 157
311 The high order digit of a negative number is always \-1
314 The representation of \-157 is 43,98,\-1.
315 We shall call this the canonical form of a number.
316 The advantage of this kind of representation of negative
317 numbers is ease of addition. When addition is performed digit
323 and the handling of carries done later when
327 the high order digit to indicate the number of
332 The value of this extra byte is called the
341 for all of its internal storage.
342 All reading and writing of numbers internally is done through
345 to the beginning of the string, the end of the string,
352 to this string are on a list of free headers.
354 The size of the string actually supplied is the next higher
355 power of 2.
358 a string of the desired size.
360 it has a string of the right size.
369 This is an implementation of the `buddy system' of allocation
372 Failing to find a string of the proper length after coalescing,
374 The amount of space on the system is the only limitation
375 on the size and number of strings in DC.
376 If at any time in the process of trying to allocate a string, the allocator runs out of
385 the characters of a string are read or written in
386 succession by a series of read or write calls.
387 The write pointer is interpreted as the end of the
388 information-containing portion of a string and a call
389 to read beyond that point returns an end-of-string indication.
390 An attempt to write beyond the end of a string
402 For example, if the scale of the operands is different and decimal
407 the proper scale factor is appended to the end of the number before
411 in the results of most arithmetic operations.
412 \fBscale\fP is the bound on the number of decimal places retained in
414 \fBscale\fP may be set to the number on the top of the stack
416 \fBK\fP may be used to push the value of \fBscale\fP on the stack.
418 The descriptions of the individual arithmetic operations will
419 include the exact effect of \fBscale\fP on the computations.
423 The scales of the two numbers are compared and trailing
426 multiplied by 10 if the difference of the scales is odd.
427 The scale of the result is then set to the larger of the scales
434 low order end of the number. The carries are propagated
437 require stripping of leading zeros, or for negative numbers
450 The first number is multiplied by each digit of the second
455 computed from the signs of the original operands.
457 The scale of the result is set equal to the sum
458 of the scales of the two operands.
463 and also larger than both of the scales of the two operands,
464 then the scale of the result is set equal to the largest
471 the scale of the result of the integer division equal to
477 The difference of the lengths of the two numbers
481 Otherwise the top digit of the divisor is divided into the top
482 two digits of the dividend.
483 The result is used as the first (high-order) digit of the
487 adjusted at the end of the process.
492 At the end, the digits of the quotient are put into
493 the canonical form, with propagation of carry as needed.
494 The sign is set from the sign of the operands.
499 exactly as described. The quantity returned is the remains of the
500 dividend at the end of the divide process.
503 The scale of the remainder is set to
504 the maximum of the scale of the dividend and
505 the scale of the quotient plus the scale of the divisor.
511 integer result have a scale that is the larger of
514 and the scale of the operand.
533 obtained as a product of those powers of the base that
534 correspond to the positions of the one-bits in the binary
535 representation of the exponent.
536 Enough digits of the result
537 are removed to make the scale of the result the same as if the
544 The scale stored with a number is simply the number of fractional digits input.
547 The hexadecimal digits A\-F correspond to the numbers 10\-15 regardless of input base.
548 The \fBi\fP command can be used to change the base of the input numbers.
553 The command \fBI\fP will push the value of the input base on the stack.
557 The command \fBp\fP causes the top of the stack to be printed.
558 It does not remove the top of the stack.
559 All of the stack and internal registers can be output
562 This command uses the top of the stack, truncated to an integer as
566 The command \fBO\fP pushes the value of the output base on the stack.
571 the interpretation of numbers on input and output; they have no
575 All choices of input and output bases work correctly, although not all are
577 A particularly useful output base is 100000, which has the effect of
579 Bases of 8 and 16 can be used for decimal-octal or decimal-hexadecimal
586 The command \fBs\fIx\fR pops the top of the stack and
589 \fBl\fIx\fR puts the contents of register \fBx\fP on the top of the stack.
590 The \fBl\fP command has no effect on the contents of register \fIx\fP.
596 The command \fBd\fP pushes a duplicate of the number on the top of the stack
599 The command \fBX\fP replaces the number on the top of the stack
601 The command \fBZ\fP replaces the top of the stack
615 The \fBx\fP command assumes the top of the stack is an string of DC commands
633 \fBS\fIx\fR pushes the top value of the main stack onto the stack for
639 \fBl\fP doesn't effect the top of the
649 The value on the top of the stack is the index
650 into the array \fIx\fP of the value to be loaded.
654 The command \fB!\fP interprets the rest of the line as a
660 This command uses the top of the stack as the number of levels of recursion to skip.
664 The real reason for the use of a dynamic storage allocator was
666 used for a variety of other tasks.
671 cost in execution time, all considerations of string allocation
672 and sizes of strings were removed from the remainder of the program
674 used wastes approximately 25% of available space.
676 The choice of 100 as a base for internal arithmetic
678 exceed 127 because of hardware limitations and at the cost
685 was a considerable degree of logical separation of the final
689 The rationale for the lack of interaction between the scale and the bases
690 was to provide an understandable means of proceeding after
691 a change of base or scale when numbers had already been entered.
692 An earlier implementation which had global notions of
694 If the value of
700 then a change of base or scale in the midst of a
703 The current scheme has the advantage that the value of
707 The value of
709 is not used for any essential purpose by any part of the program
710 and it is used only to prevent the number of
714 The design rationale for the choices for the scales of
715 the results of arithmetic were that in no case should
724 seemed reasonable to give as a minimum the number of decimal
726 number of digits
729 The operation of division gives arbitrarily many decimal places
735 The scale of remainder was chosen to make it possible