stat_val = 1 auto_val = 124 stat_val = 2 auto_val = 1 stat_val = 3 auto_val = 65 stat_val = 4 auto_val = 65
NOTE: HP Fortran provides the AUTOMATIC and STATIC statements as porting extensions. The STATIC statement is functionally the same as the SAVE statement, and the AUTOMATIC statement may be used to declare a variable as automatic. However, such a declaration is generally pointless because variables compiled under HP Fortran are automatic by default.
The HP Fortran Programmer's Reference provides detailed information about the AUTOMATIC, SAVE, and STATIC statements.
Increasing the precision of constants
By default, HP Fortran evaluates all
3.14159265358979323846
as though you had specified:
3.1415927
Although the loss of precision might be acceptable when assigning to
NOTE: HP Fortran provides two ways to override the default precision of individual constants: the kind parameter and the exponent form. The kind parameter indicates the precision of
In the following example, the kind parameter _8 specifies that the constant is to be evaluated as
3.14159265358979323846_8
To change the precision of all
To promote all
$ f90 +real_constant=double x.f y.f z.f
The +real_constant=singleoption specifies that all
$ f90 +real_constant=single a.f b.f c.f
Note that +real_constant=singledoes not demote constants that use either the kind parameter or the exponent form (for example, 4.0D0) .
For information about increasing the precision of variables, see “Increasing default data sizes” (page 70). The HP Fortran Programmer’s Reference describes the syntax of the kind parameter and the exponent form and the +real_constant option. For detailed information about how
Increasing the precision of constants | 69 |