Integers
Describes integers (int) in
OPL.
Shows how to declare integers in the OPL language.
OPL contains the integer constant maxint, which represents the largest positive integer
available. OPL provides the subset of the integers ranging from -maxint to maxint as
a basic data type.
A declaration of the form
int i = 25; declares an integer, i, whose
value is 25.
The initialization of an integer can be specified by an expression. For instance, the declaration
int n = 3;
int size = n*n;
initializes size as the square
of n. Expressions are covered in detail
in Expressions.