VMS Help  —  FORTRAN  Format Specifiers, P
  nP (Scale Factor Editing)

  The scale factor lets you alter, during input or output, the
  location of the decimal point both in real values and in the two
  parts of complex values.

  The "n" is a signed or unsigned integer constant, in the range -128
  to 127, that specifies the number of positions to the left or right
  that the decimal point is to move.

  A scale factor can appear anywhere in a format specification, but
  must precede the first F, E, D, EN, ES, or G field descriptor that
  is to be associated with it and affects all subsequent real field
  descriptors in the same FORMAT statement (unless another scale
  factor appears).

  On input the scale factor of any of the F, E, D, EN, ES, and G
  field descriptors multiplies the data by 10**-n and assigns it to
  the corresponding I/O list element.  For example a 2P scale factor
  multiplies an input value by .01; a -2P multiplies an input value
  by 100.  However, if the external field contains an explicit
  exponent, the scale factor has no effect.

  E, D, EN, ES, and G field descriptors alter the form in which data
  is transferred.  On input a positive scale factor moves the decimal
  point to the left and a negative scale factor moves the decimal
  point to the right; on output, the effect is the reverse.

1  –  F editing

  nPFw.d

  On output, the value of the I/O list element is multiplied by 10**n
  before transfer to the external record.  Thus, a positive scale
  factor moves the decimal point to the right; a negative scale
  factor moves the decimal point to the left.  Thus, the F descriptor
  alters the magnitude of the data.

2  –  E editing

  nPEw.d

  On output, the basic real constant part of the I/O list element is
  multiplied by 10**n, and "n" is subtracted from the exponent.  For
  a positive scale factor, "n" must be less than d+2 or an output
  conversion error occurs.  Thus, a positive scale factor moves the
  decimal point to the right and decreases the exponent; a negative
  scale factor moves the decimal point to the left and increases the
  exponent.

3  –  D editing

  nPDw.d

  On output, the basic real constant part of the I/O list element is
  multiplied by 10**n, and "n" is subtracted from the exponent.  For
  a positive scale factor, "n" must be less than d+2 or an output
  conversion error occurs.  Thus, a positive scale factor moves the
  decimal point to the right and decreases the exponent; a negative
  scale factor moves the decimal point to the left and increases the
  exponent.

4  –  EN editing

  On output, the scale factor has no effect on EN editing.

5  –  ES editing

  On output, the scale factor has no effect on ES editing.

6  –  G editing

  nPGw.d

  On output, the effect for the G field descriptor is suspended if
  the magnitude of the data to be output is within the effective
  range of the descriptor (because the G field descriptor supplies
  its own scaling function).  It functions as an E field descriptor
  if the magnitude of the data is outside its range.  In this case,
  the scale factor has the same effect as for the E field descriptor.
Close Help