Operators
Arc operator reference for arithmetic, comparison, logical, assignment, and flow operators
Arithmetic operators
Division behavior
Integer division truncates toward zero:
positive := 10 / 3 // 3 (not 3.333)
negative := -10 / 3 // -3Float division produces a float:
result := 10.0 / 3.0 // 3.333...Exponentiation
power := 2 ^ 8 // 256
square := 5 ^ 2 // 25
cube := 2.0 ^ 3 // 8.0Exponentiation is right-associative:
result := 2 ^ 3 ^ 2 // 2 ^ (3 ^ 2) = 2 ^ 9 = 512Comparison operators
All comparisons return bool (true or false).
in_range := pressure >= 100 and pressure <= 500Logical operators
Logical operators require bool operands, use short-circuit evaluation, and return
bool.
Short-circuit evaluation
and: If the left operand isfalse, the right operand is not evaluatedor: If the left operand istrue, the right operand is not evaluated
// Safe: division only happens if b != 0
safe := b != 0 and (a / b) > 10Assignment operators
Variable declaration operators
Precedence table
Operators listed from highest to lowest precedence.
Precedence examples
// Exponentiation binds tighter than unary minus
-2 ^ 2 // -(2 ^ 2) = -4; write (-2) ^ 2 for 4
// Multiplication before addition
2 + 3 * 4 // 2 + (3 * 4) = 14
// Comparison before logical
a > 5 and b < 10 // (a > 5) and (b < 10)
// Use parentheses for clarity
(a + b) * cSeries operators
Arithmetic, comparison, and logical operators work element-wise on series.
data := [1.0, 2.0, 3.0]
// Series with scalar
scaled := data * 2.0 // [2.0, 4.0, 6.0]
// Series with series (must be equal length)
sum := data + [4.0, 5.0, 6.0] // [5.0, 7.0, 9.0]
// Comparison returns series bool
mask := data > 2.0 // [false, false, true]
// Logical operators apply element-wise to series bool
inverted := not mask // [true, true, false]String operators
msg := "Hello"
greeting := msg + " World" // "Hello World"
is_empty := msg == "" // falseTruthiness
Contexts that test a value accept more than bool: the
=> conditional flow operator, if
conditions, and for conditions.