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 />

216<br />

An E followed by an optionally signed integer constant<br />

A D followed by an optionally signed integer constant<br />

A Q followed by an optionally signed integer constant<br />

All four exponent forms are processed in the same way. Note, however, that e has no effect on<br />

input.<br />

The EN and ES edit descriptors are the same as the F edit descriptor on input. The Q edit<br />

descriptor (an <strong>HP</strong> <strong>Fortran</strong> extension) is the same as the E edit descriptor on input.<br />

Table 9-10 provides examples of the real edit descriptors on input. The BZ edit descriptor<br />

listed in the “Descriptor” column treats nonleading blanks in numeric fields as zeroes.<br />

Table9-10 D,E,F,andGeditdescriptors:inputexamples<br />

Descriptor Input field Value stored<br />

F6.5 4.51E4 45100<br />

G4.2 51-3 .00051<br />

E8.3 7.1bEb5 710000<br />

D9.4 bbb45E+35 .0045 x 10 35<br />

BZ, F6.1 -54E3b -5.4 x 10 30<br />

Real edit descriptors on output<br />

The output field for the real descriptors consists of w character positions, filled with leading<br />

blanks (if necessary) and an optionally signed real constant with a decimal point, rounded to d<br />

digits after the decimal point. The following sections describe the real edit descriptors on<br />

output in detail.<br />

DandEeditdescriptors The D and E edit descriptors define a normalized floating-point<br />

field for real and complex values. The value is rounded to d digits. The exponent part consists<br />

of e digits. If Ee is omitted in a D or E edit descriptor, then the exponent occupies two or three<br />

positions, depending on its magnitude. The field width, w, should follow the general rule: w is<br />

greaterthanorequaltod+7. If Ee is used, w isgreaterthanorequaltod+e+5. This rule<br />

provides positions for a leading blank, the sign of the value, the decimal point, d digits, the<br />

exponent letter (D, E, orQ), the sign of the exponent, and the exponent. The Ee, De, andQe<br />

specifications, which are available with the E edit descriptor, control which exponent letter is<br />

output.<br />

Chapter 9

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

Saved successfully!

Ooh no, something went wrong!