Operators
Order of operations
TrueMath evaluates an expression in this order, from highest precedence to lowest:- Exponentiation (
^) - Negation (
-x) - Multiplication and division (
*,/) - Addition and subtraction (
+,-) - Comparison (
>,<,>=,<=,==,!=) - Logical (
&&,\|\|,!) - Assignment (
=) — the lowest precedence, so the entire right-hand side is evaluated before it is assigned (x = a + b * ccomputesa + b * c, then assigns).
sqrt or pmt aren’t operators: a function call evaluates its arguments and resolves to a single value before any surrounding operator applies.
-2^2 is -(2^2) = -4. Use
parentheses whenever the intended grouping isn’t obvious — TrueMath evaluates
(a + b) / c exactly as written.
Boolean results
Comparison and logical operators produce1 (true) or 0 (false), and a condition
expects a boolean — true/false or 1/0.
The condition must be a scalar. See Booleans for
how true/false relate to 1/0 and how other values are evaluated.
