02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I/O formatting<br />

Edit descriptors<br />

The BN and BZ edit descriptors are ignored during the execution of an output statement.<br />

D, E, EN, ES, F, G, and Q (real) edit descriptors<br />

The D, E, EN, ES, F, G, andQ edit descriptors define fields for real numbers. The I/O list item<br />

corresponding to a real descriptor must be a numeric type. (The Standard permits real and<br />

complex types only; as an extension, <strong>HP</strong> <strong>Fortran</strong> allows integers.)<br />

The syntax for these edit descriptors is:<br />

[r]D[w.d]<br />

[r]E[w.d[{E|D|Q}e]]<br />

[r]EN[w.d[Ee]]<br />

[r]ES[w.d[Ee]]<br />

[r]F[w.d]<br />

[r]G[w.d[{E|D|Q}e]]<br />

[r]Q[w.d]<br />

where:<br />

r is a positive integer constant, specifying the repeat factor.<br />

w is a positive integer constant, specifying the field width.<br />

d is a nonnegative integer constant, specifying the number of decimal places<br />

on output.<br />

e is a positive integer constant, specifying the number of digits in the<br />

exponent.<br />

For formatting complex data, you can use two real edit descriptors—the first for the real part<br />

of the number and the second for the imaginary part. The two edit descriptors may be<br />

different or the same, and you can insert control and character string edit descriptors between<br />

them.<br />

Real edit descriptors on input<br />

The input field for the real descriptors consists of an optional plus or minus sign followed by a<br />

string of digits that may contain a decimal point. If the decimal point is omitted in the input<br />

string, then the number of digits equal to d from the right of the string are interpreted to be to<br />

the right of the decimal point. If a decimal point appears in the input string and conflicts with<br />

the edit descriptor, the decimal point in the input string takes precedence. This basic form can<br />

be followed by an exponent in one of the following forms:<br />

A signed integer constant<br />

Chapter 9 215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!