11/3/71 | DC (I) |
| |
NAME |
dc -- desk calculator |
SYNOPSIS |
dc |
DESCRIPTION |
dc is an arbitrary precision integer arithmetic package.The overall structure of dc is a stacking (reverse Polish) |
| |
| calculator. The following constructions are recognized bythe calculator: |
| |
| numberThe value of the number is pushed on the stack. If the |
| |
| number starts with a zero, it is taken to be octal,otherwise it is decimal. |
| |
| + - * / %The top two values on the stack are added (+-), subtracted |
| |
| (--), multiplied (*), divided (*) or remaindered (%) Thetwo entries are popped off of the stack, the result is pushed on the stack in their place. sx The top of the stack is popped and stored into a |
| |
| register named x, where x may be any character. lx The value in register x is pushed on the |
| |
| stack. The register x is not altered. d The top value on the stack is pushed on the |
| |
| stack. Thus the top value is duplicated. p The top value on the stack is printed in decimal. The |
| |
| top value remains unchanged. f All values on the stack are popped off and |
| |
| printed in decimal. r All values on the stack are popped. |
| |
| q exit. h print brief synopsis of commands to dc. |
| |
| new--linespace ignored. An example to calculate the monthly, weekly and |
| |
| |