Skip to main content

Access

All C++ constants are exposed to your Lua script via a single global table named constants. You access individual values by using the dot (.) or bracket ([]) operator on this table.
Constant Usage Example
local uint64_max_constant = constants.uint64_max; -- Dot Operator
local float_max_constant = constants["flt_max"]; -- Bracket Operator

Members

This section lists all available C++ constants and macro equivalents exposed within the global constants 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.
int8_min
number
The minimum signed 8-bit integer value.
int16_min
number
The minimum signed 16-bit integer value.
int32_min
number
The minimum signed 32-bit integer value.
int64_min
number
The minimum signed 64-bit integer value.
int8_max
number
The maximum signed 8-bit integer value.
int16_max
number
The maximum signed 16-bit integer value.
int32_max
number
The maximum signed 32-bit integer value.
int64_max
number
The maximum signed 64-bit integer value.
uint8_max
number
The maximum unsigned 8-bit integer value.
uint16_max
number
The maximum unsigned 16-bit integer value.
uint32_max
number
The maximum unsigned 32-bit integer value.
uint64_max
number
The maximum unsigned 64-bit integer value.

Doubles

This section lists all available double-precision floating-point C++ constant macros.
dbl_decimal_dig
number
The number of decimal digits of precision.
dbl_dig
number
The number of significant decimal digits.
dbl_epsilon
number
The difference between 11 and the least value greater than 11 that is representable in the double format.
dbl_has_subnorm
number
Indicates the presence of subnormal values (often 11 for present, 00 for absent).
dbl_mant_dig
number
The number of base BB digits in the mantissa.
dbl_max
number
The maximum finite representable double-precision floating-point number.
dbl_max_10_exp
number
The maximum integer such that 1010 raised to this power is representable.
dbl_max_exp
number
The maximum binary exponent such that 22 raised to this power is representable.
dbl_min
number
The minimum positive normalized double-precision floating-point number.
dbl_min_10_exp
number
The minimum integer such that 1010 raised to this power is a normalized number.
dbl_min_exp
number
The minimum binary exponent such that 22 raised to this power is a normalized number.
dbl_radix
number
The base of the exponent (usually 22).
dbl_true_min
number
The minimum positive unnormalized (subnormal) double-precision floating-point number.

Floats

This section lists all available single-precision floating-point C++ constant macros.
flt_decimal_dig
number
The number of decimal digits of precision.
flt_dig
number
The number of significant decimal digits.
flt_epsilon
number
The difference between 11 and the least value greater than 11 that is representable in the float format.
flt_has_subnorm
number
Indicates the presence of subnormal values (often 11 for present, 00 for absent).
flt_mant_dig
number
The number of base BB digits in the mantissa.
flt_max
number
The maximum finite representable single-precision floating-point number.
flt_max_10_exp
number
The maximum integer such that 1010 raised to this power is representable.
flt_max_exp
number
The maximum binary exponent such that 22 raised to this power is representable.
flt_min
number
The minimum positive normalized single-precision floating-point number.
flt_min_10_exp
number
The minimum integer such that 1010 raised to this power is a normalized number.
flt_min_exp
number
The minimum binary exponent such that 22 raised to this power is a normalized number.
flt_radix
number
The base of the exponent (usually 22).
flt_true_min
number
The minimum positive unnormalized (subnormal) single-precision floating-point number.
I