Numeric constants

Provides a reference for numeric constants in OPL.

The following numeric constants are defined.

Table 1. Numeric constants
Syntax Value
NaN Contains the NaN value.
Infinity Contains the Infinity value.
Number.NaN Same as NaN.
Number.MAX_VALUE The maximum representable number, approximately 1.79E+308.
Number.MIN_VALUE The smallest representable positive number, approximately 2.22E-308.
Math.E Napier’s constant, e, and the base of natural logarithms, approximately 2.718.
Math.LN10 The natural logarithm of 10, approximately 2.302.
Math.LN2 The natural logarithm of 2, approximately 0.693.
Math.LOG2E The base 2 logarithm of e, approximately 1.442.
Math.LOG10E The base 10 logarithm of e, approximately 0.434.
Math.PI The ratio of the circumference of a circle to its diameter, approximately 3.142.
Math.SQRT1_2 The square root of one-half, approximately 0.707.
Math.SQRT2 The square root of 2, approximately 1.414.