(dc.info)Status Inquiry


Next: Miscellaneous Prev: Strings Up: Top
Enter node , (file) or (file)node

9 Status Inquiry
****************

'Z'
     Pops a value off the stack, calculates the number of decimal digits
     it has (or number of characters, if it is a string) and pushes that
     number.

     Note that the digit count for a number does _not_ include any
     leading zeros, even if those appear to the right of the radix
     point.  This may seem a bit strange at first, but it is compatible
     with historical implementations of 'dc', and can be argued to be
     useful for computing the magnitude of a value: 'dSaXLaZ-' will
     compute the power-of-ten multiplier which would be needed to shift
     the decimal point to be immediately before the leftmost non-zero
     digit.

'X'
     Pops a value off the stack, calculates the number of fraction
     digits it has, and pushes that number.  For a string, the value
     pushed is 0.

'z'
     Pushes the current stack depth: the number of objects on the stack
     before the execution of the 'z' command.


automatically generated by info2www version 1.2.2.9