(dc.info.gz) Printing Commands

Info Catalog (dc.info.gz) Invocation (dc.info.gz) Top (dc.info.gz) Arithmetic
 
 3 Printing Commands
 *******************
 
 'p'
      Prints the value on the top of the stack, without altering the
      stack.  A newline is printed after the value.
 
 'n'
      Prints the value on the top of the stack, popping it off, and does
      not print a newline after.  (This command is a GNU extension.)
 
 'P'
      Pops off the value on top of the stack.  If it it a string, it is
      simply printed without a trailing newline.  Otherwise it is a
      number, and the integer portion of its absolute value is printed
      out as a "base (UCHAR_MAX+1)" byte stream.  Assuming that
      (UCHAR_MAX+1) is 256 (as it is on most machines with 8-bit bytes),
      the sequence 'KSK0k1/ _1Ss[ls*]Sxd0>x [256~Ssd0<x]dsxx
      sx[q]Sq[Lsd0>qaPlxx]dsxx sx0sqLqsxLxLK+k' could also accomplish
      this function.  (Much of the complexity of the above native-dc code
      is due to the ~ computing the characters backwards, and the desire
      to ensure that all registers wind up back in their original
      states.)  (Details of the behavior with a number are a GNU
      extension.  Traditional 'dc' happened to "support" similar
      functionality for a limited range of inputs as an accidental
      side-effect of its internal representation of numbers.)
 
 'f'
      Prints the entire contents of the stack without altering anything.
      This is a good command to use if you are lost or want to figure out
      what the effect of some command has been.
 
    All numeric output is split to fit within 70 columns, by default.
 When a number is broken up in this way, the split is indicated by a "\"
 at the end of the to-be-continued output lines.  The column width at
 which output is split can be overridden by setting the DC_LINE_LENGTH
 environment variable to the desired width.  A DC_LINE_LENGTH of 0 (zero)
 disables the line-split feature altogether.  Invalid values of
 DC_LINE_LENGTH are silently ignored.  (The DC_LINE_LENGTH variable is a
 GNU extension.)
 
Info Catalog (dc.info.gz) Invocation (dc.info.gz) Top (dc.info.gz) Arithmetic
automatically generated by info2html