Operations
Learn how to perform mathematical and logical operations using natural language syntax.
Addition
Use plus to add numbers together. You can chain multiple additions.
Subtraction
Use minus to subtract one number from another.
Multiplication
Use times to multiply numbers together.
Division
Use divided by to divide one number by another.
Operations are evaluated from left to right with standard mathematical precedence:
String Concatenation
Use plus to join strings together. This works the same as adding numbers.
Mixing Numbers and Strings
Numbers are automatically converted to strings when combined with text.
Increment (Add 1)
Shorthand for adding 1 to a variable.
Decrement (Subtract 1)
Shorthand for subtracting 1 from a variable.
Equality Comparisons
Magnitude Comparisons
Inclusive Comparisons
Usage in Conditions
Accumulation Pattern
Building up a sum or total over multiple iterations.
Average Calculation
Dividing a total by the number of items to get the average.
Percentage Calculation
Converting a fraction to a percentage.
Use parentheses for clarity
While not currently supported, plan your expressions to avoid ambiguity.
Break complex calculations into steps
Use intermediate variables for complex expressions to improve readability.
Be careful with division by zero
Always ensure youre not dividing by zero to avoid runtime errors.