Arithmetic operators in Wave include standard mathematical operations like addition, subtraction, multiplication, and division.
Example:
var result: i32 = 10 + 5; // Addition
result = result - 3; // Subtraction
result = result * 2; // Multiplication
result = result / 2; // Division
Wave includes special operators like the null-coalescing operator ??
and the conditional (ternary) operator ?:
for additional flexibility in expressions.
Example:
var value = optionalValue ?? defaultValue; // Null-coalescing
var result = (a > b) ? "A is greater" : "B is greater"; // Conditional operator