Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

INTEGER Statement

Statement: Specifies the INTEGER data type.

INTEGER

INTEGER([KIND=] n)

INTEGER*n

n

Is kind 1, 2, 4, or 8.

If a kind parameter is specified, the integer has the kind specified. If a kind parameter is not specified, integer constants are interpreted as follows:

  • If the integer constant is within the default integer kind range, the kind is default integer.

  • If the integer constant is outside the default integer kind range, the kind of the integer constant is the smallest integer kind which holds the constant.

The default kind can also be changed by using the INTEGER directive or compiler options specifying integer size.

Example

! Entity-oriented declarations:
INTEGER, DIMENSION(:), POINTER :: days, hours
INTEGER (2) :: k=4
INTEGER (2), PARAMETER :: limit=12

! Attribute-oriented declarations:
INTEGER days, hours
INTEGER (2):: k=4, limit
DIMENSION days(:), hours(:)
POINTER days, hours
PARAMETER (limit=12)