MPE/iX Shell and Utilities Reference Manual, Vol 1
dc(1) MPE/iX Shell and Utilities dc(1)
k pops the top value off the stack and uses it as the default scaling factor (see the sec-
tion on The Scaling Factor).
Lx pops the top value off the register stack x (see the S command) and pushes that value
onto the main stack. If the register has never contained a value, dc treats this as an
error. (Contrast this behavior with the way that the lx operator works.) This opera-
tor also pops the array component of the specified register. See the Array Operations
section for more information.
lx takes the value from register x and pushes it onto the stack. This does not change the
value of the register. If the register has never contained a value, dc puts a value of
zero on the stack.
P pops the top value off the stack, prints it as a string, and then discards it. If the value
is a string, dc prints it as such. If it is a number, dc prints the
ASCII
character with
that value.
p prints the top value on the stack. The value remains on the stack.
q quits a dc session; however, see the Executing Strings section for an exception.
Sx pops the top value off the stack and pushes this value onto the register x as if the reg-
ister itself were another stack. In this way, you can use a single register to hold a
sequence of values. This operation also pushes the array component of the register
onto the register’s stack. See the Array Operations section for more information.
sx pops the top value off the stack and stores it in the register x. For example, sa pops
the stack and stores the value in register a.
v replaces the top value on the stack with its square root. dc ignores the scaling factor
when performing calculations to find the square root. The number of decimal places
in the result is the maximum of the number of decimal places in the original value or
the scaling factor.
X replaces the value on the top of the stack with the number of decimal places in the
number.
x executes a string. See Executing Strings.
Z replaces the number on the top of the stack with its length (that is, the number of
digits in the number).
Note: dc ignores the minus sign and decimal point when calculating this value, so
that 12345 and _123.45 have the same length.
z determines how many values are currently on the stack, then pushes that number onto
the stack.
Commands and Utilities 1-159