To duplicate the top object on the stack, press `RET` or `SPC`
(two equivalent keys for the `calc-enter`

command).
Given a positive numeric prefix argument, these commands duplicate
several elements at the top of the stack.
Given a negative argument,
these commands duplicate the specified element of the stack.
Given an argument of zero, they duplicate the entire stack.
For example, with ‘`10 20 30`’ on the stack,
`RET` creates ‘`10 20 30 30`’,
`C-u 2 RET` creates ‘

The `LFD` (`calc-over`

) command (on a key marked Line-Feed if you
have it, else on `C-j`) is like `calc-enter`

except that the sign of the numeric prefix argument is interpreted
oppositely. Also, with no prefix argument the default argument is 2.
Thus with ‘`10 20 30`’ on the stack, `LFD` and `C-u 2 LFD`
are both equivalent to

To remove the top element from the stack, press `DEL` (`calc-pop`

).
The `C-d` key is a synonym for `DEL`.
(If the top element is an incomplete object with at least one element, the
last element is removed from it.) Given a positive numeric prefix argument,
several elements are removed. Given a negative argument, the specified
element of the stack is deleted. Given an argument of zero, the entire
stack is emptied.
For example, with ‘`10 20 30`’ on the stack,
`DEL` leaves ‘`10 20`’,
`C-u 2 DEL` leaves ‘

The `M- DEL` (

`calc-pop-above`

) command is to The above commands do not depend on the location of the cursor.
If the customizable variable `calc-context-sensitive-enter`

is
non-`nil`

(see Customizing Calc), these commands will become
context sensitive. For example, instead of duplicating the top of the stack,
`RET` will copy the element at the cursor to the top of the
stack. With a positive numeric prefix, a copy of the element at the
cursor and the appropriate number of preceding elements will be placed
at the top of the stack. A negative prefix will still duplicate the
specified element of the stack regardless of the cursor position.
Similarly, `DEL` will remove the corresponding elements from the
stack.

To exchange the top two elements of the stack, press `TAB`
(`calc-roll-down`

). Given a positive numeric prefix argument, the
specified number of elements at the top of the stack are rotated downward.
Given a negative argument, the entire stack is rotated downward the specified
number of times. Given an argument of zero, the entire stack is reversed
top-for-bottom.
For example, with ‘`10 20 30 40 50`’ on the stack,
`TAB` creates ‘`10 20 30 50 40`’,
`C-u 3 TAB` creates ‘

The command `M- TAB` (

`calc-roll-up`

) is analogous to A good way to view the operation of `TAB` and `M- TAB` is in
terms of moving a particular element to a new position in the stack.
With a positive argument

With a negative argument *- n*,

See Selecting Sub-Formulas, for a way to apply these commands to any portion of a vector or formula on the stack.

The command `C-x C-t` (`calc-transpose-lines`

) will transpose
the stack object determined by the point with the stack object at the
next higher level. For example, with ‘`10 20 30 40 50`’ on the
stack and the point on the line containing ‘`30`’, `C-x C-t`
creates ‘`10 20 40 30 50`’. More generally, `C-x C-t` acts on
the stack objects determined by the current point (and mark) similar
to how the text-mode command `transpose-lines`

acts on
lines. With argument `n`, `C-x C-t` will move the stack object
at the level above the current point and move it past N other objects;
for example, with ‘`10 20 30 40 50`’ on the stack and the point on
the line containing ‘`30`’, `C-u 2 C-x C-t` creates
‘`10 40 20 30 50`’. With an argument of 0, `C-x C-t` will switch
the stack objects at the levels determined by the point and the mark.