dc: Stack Control

1 
1 5 Stack Control
1 ***************
1 
1 'c'
1      Clears the stack, rendering it empty.
1 
1 'd'
1      Duplicates the value on the top of the stack, pushing another copy
1      of it.  Thus, '4d*p' computes 4 squared and prints it.
1 
1 'r'
1      Reverses the order of (swaps) the top two values on the stack.
1      (This can also be accomplished with the sequence 'SaSbLaLb'.)
1      (This command is a GNU extension.)
1 
1 'R'
1      Pops the top-of-stack as an integer N.  Cyclically rotates the top
1      N items on the updated stack.  If N is positive, then the rotation
1      direction will make the topmost element the second-from top; if N
1      is negative, then the rotation will make the topmost element the
1      N-th element from the top.  If the stack depth is less than N then
1      the entire stack is rotated (in the appropriate direction), without
1      any error being reported.  (This command is a GNU extension.)
1