dc, an arbitrary precision calculator - 5. Stack Control

Go to the first, previous, next, last section, table of contents.

# 5. Stack Control

``c'`
  Clears the stack, rendering it empty.
``d'`
  Duplicates the value on the top of the stack, pushing another copy of it. Thus, ``4d*p'` computes 4 squared and prints it.
``r'`
  Reverses the order of (swaps) the top two values on the stack. (This command is a GNU extension.)

Go to the first, previous, next, last section, table of contents.