dc: Status Inquiry
1
1 9 Status Inquiry
1 ****************
1
1 'Z'
1 Pops a value off the stack, calculates the number of decimal digits
1 it has (or number of characters, if it is a string) and pushes that
1 number.
1
1 Note that the digit count for a number does _not_ include any
1 leading zeros, even if those appear to the right of the radix
1 point. This may seem a bit strange at first, but it is compatible
1 with historical implementations of 'dc', and can be argued to be
1 useful for computing the magnitude of a value: 'dSaXLaZ-' will
1 compute the power-of-ten multiplier which would be needed to shift
1 the decimal point to be immediately before the leftmost non-zero
1 digit.
1
1 'X'
1 Pops a value off the stack, calculates the number of fraction
1 digits it has, and pushes that number. For a string, the value
1 pushed is 0.
1
1 'z'
1 Pushes the current stack depth: the number of objects on the stack
1 before the execution of the 'z' command.
1