VMS Help
FORTRAN, Format Specifiers, P
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
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, or G field descriptor that is to be
associated with it and affects all following 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, 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, or 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.
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 field
descriptor alters the magnitude of the data.
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.
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.
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.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.