Access
All C++ constants are exposed to your Lua script via a single global table namedconstants
. You access individual values by using the dot (.
) or bracket ([]
) operator on this table.
Constant Usage Example
Members
This section lists all available C++ constants and macro equivalents exposed within the globalconstants
table. These members provide fixed numerical values, such as maximum/minimum limits for various integer and floating-point types.
Integers
This section lists all available integer-based C++ constant macros. The minimum signed 8-bit integer value.
The minimum signed 16-bit integer value.
The minimum signed 32-bit integer value.
The minimum signed 64-bit integer value.
The maximum signed 8-bit integer value.
The maximum signed 16-bit integer value.
The maximum signed 32-bit integer value.
The maximum signed 64-bit integer value.
The maximum unsigned 8-bit integer value.
The maximum unsigned 16-bit integer value.
The maximum unsigned 32-bit integer value.
The maximum unsigned 64-bit integer value.
Doubles
This section lists all available double-precision floating-point C++ constant macros. The number of decimal digits of precision.
The number of significant decimal digits.
The difference between and the least value greater than that is representable in the double format.
Indicates the presence of subnormal values (often for present, for absent).
The number of base digits in the mantissa.
The maximum finite representable double-precision floating-point number.
The maximum integer such that raised to this power is representable.
The maximum binary exponent such that raised to this power is representable.
The minimum positive normalized double-precision floating-point number.
The minimum integer such that raised to this power is a normalized number.
The minimum binary exponent such that raised to this power is a normalized number.
The base of the exponent (usually ).
The minimum positive unnormalized (subnormal) double-precision floating-point number.
Floats
This section lists all available single-precision floating-point C++ constant macros. The number of decimal digits of precision.
The number of significant decimal digits.
The difference between and the least value greater than that is representable in the float format.
Indicates the presence of subnormal values (often for present, for absent).
The number of base digits in the mantissa.
The maximum finite representable single-precision floating-point number.
The maximum integer such that raised to this power is representable.
The maximum binary exponent such that raised to this power is representable.
The minimum positive normalized single-precision floating-point number.
The minimum integer such that raised to this power is a normalized number.
The minimum binary exponent such that raised to this power is a normalized number.
The base of the exponent (usually ).
The minimum positive unnormalized (subnormal) single-precision floating-point number.