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.

Data types and data objects<br />

Intrinsic data types<br />

Constants<br />

Constants can be either literal or named. A literal constant is a sequence of characters that<br />

represents a value. A named constant is a variable that has been initialized and has the<br />

PARAMETER attribute. This section describes the formats of literal constants for each of the<br />

intrinsic data types. For more information about named constants and the PARAMETER<br />

statement and attribute, see Chapter 10.<br />

Integer constants<br />

The format of a signed integer literal constant is:<br />

[sign] digit-string [_kind-parameter]<br />

sign<br />

digit-string<br />

kind-parameter<br />

32<br />

is either + or -.<br />

takes the form:<br />

digit[digit] ...<br />

is one of:<br />

digit-string<br />

the name of a scalar integer constant<br />

The following are examples of integer constants:<br />

-123<br />

123_1<br />

123_ILEN<br />

In the last example, ILEN is a named integer constant used as a kind parameter. It must have<br />

a value of 1, 2, 4, or 8.<br />

BOZ constants<br />

<strong>Fortran</strong> 90 allows DATA statements to include constants that are formatted in binary, octal, or<br />

hexadecimal base. Such constants are called BOZ constants.<br />

A binary constant is:<br />

leading-letter{'digit-string'|"digit-string"}<br />

Chapter 3

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

Saved successfully!

Ooh no, something went wrong!