FORTRAN 77 Language Reference

## Integer Constants

An integer constant consists of an optional plus or minus sign, followed by a string of decimal digits.

Restrictions:

• No other characters are allowed except, of course, a space.

• If no sign is present, the constant is assumed to be nonnegative.

• The value must be in the INTEGER*4 range (-2147483648, 2147483647), unless compiled with an option that promotes integers to 64 bits, in which case the range becomes INTEGER*8 (-9223372036854775808,9223372036854775807). See "Size and Alignment of Data Types ".

Example: Integer constants:

```-2147483648
-2147483649 							Invalid-too small, error message
-10
0
+199
29002
2.71828 							Not INTEGER-decimal point not allowed
1E6							Not INTEGER-E not allowed
29,002 							Invalid-comma not allowed, error message
2147483647
2147483648 							Invalid- too large, error message
```

### Alternate Octal Notation @

You can also specify integer constants with the following alternate octal notation. Precede an integer string with a double quote (") and compile with the -xl option. These are octal constants of type INTEGER.

Example: The following two statements are equivalent:

```	JCOUNT = ICOUNT + "703
JCOUNT = ICOUNT + 451```

You can also specify typeless constants as binary, octal, hexadecimal, or Hollerith. See "Typeless Constants (Binary, Octal, Hexadecimal) ".

### Long Integers @

Compiling with an option that promotes the range from INTEGER*4(-21474836, 21474836) to INTEGER*8 (-9223372036854775808, 9223372036854775807). The integer constant is stored or passed as an 8-byte integer, data type INTEGER*8.

### Short Integers @

If a constant argument is in the range (-32768, 32767), it is usually widened to a 4-byte integer, data type INTEGER*4; but compiling with the -i2 option will cause it to be stored or passed as a 2-byte integer, data type INTEGER*2.