Skip to main content
Skip table of contents

Mathematical Operations

The simulator comes with the following built in operations:

-x

Negates x, e.g. 5 becomes -5

x ^ y

Becomes x raised to y

x * y

Becomes x times y

x / y

Becomes x divided by y

x % y

Becomes the remainder after x divided by y

x + y

Becomes x plus y

x - y

Becomes x minus y

x <= y

True if x is less than or equal to y, otherwise false

x < y

True if x is less than y, otherwise false

x >= y

True if x is greater than or equal to y, otherwise false

x > y

True if x is greater than y, otherwise false

x != y

True if x is not equal to y, otherwise false

x = y, x == y

True if x is equal to y, otherwise false

!x

Makes false become true and true become false

x and y

True if both x and y are true, otherwise false

x or y

False if both x and y are false, otherwise true

if x then y else z

Becomes y if x is true, otherwise z

x ? y : z

Becomes y if x is true, otherwise z

Operations are evaluated in the order of the table. If you want to override this order, use parentheses to explicitly define how the expression is evaluated.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.