DCode

Covers Engine 2.0.0

Lua expressions

DCode expressions inherit Lua operators, calls, indexing, literals, and table behavior.

Syntax

<Lua 5.4 expression>

Available in

  • File scope
  • Executable DCode bodies

Native C++

Native expressions are a numeric/boolean subset with C++ arithmetic types: 5 / 2 evaluates to 2, while 5.0 / 2.0 evaluates to 2.5. Use decimal literals when floating division is intended. Use math.pow(a, b) for exponentiation, math.floor(a / b) for floor division, and math.fmod(a, b) for a floating remainder (its sign semantics differ from Lua %). Strings, tables, indexing, length and concatenation are unsupported. Logical operators compile to C++ boolean operators, not Lua operand-returning and/or; compare numeric flags explicitly.