Operators

List of operators an priority

Math operators

In RedCrab, mathematical expressions are entered in the mathematical notation. An expression can contain numbers, variables, operators, and functions.

The mathematical operators have different priorities that determine the order of their computation. The following list shows the priority levels of the mathematical operators

• If a expression contains operators with the same priority, it is calculated from left to right

• Calculations within a pair of brackets are evaluated first

1. ∙, /, DIV, MOD, AND
2. +, -, OR, XOR
3. <, >, ≤, ≥, ≡, ≠

Arithmetic operators

keyboard input

= x = 3 assigning of a value
= 9 + 3 = 12 display of the result
+ 9 + 3 = 12 addition
- 9 - 3 = 6 subtraction
9 ∙ 3 = 27 multiplication *
/ 9 / 3 = 3 division
Div 9 Div 4 = 2 integer division with remainder
Mod 9 Mod 4 = 1 remainder of an integer division

Bit Operators

And 9 And 3 = 1 bitwise »and«
Or 9 Or 3 = 11 bitwise »or«
Xor 9 Xor 3 = 10 bitwise »exclusive or«

Boolsche operators

< 9 < 3 = 0 less than
> 9 > 3 = 1 greater than
9 ≤ 3 = 0 less or equal than <=
9 ≥ 3 = 1 greater or equal than >=
9 ≡ 3 = 0 is equal ==
9 ≠ 3 = 1 is not equal <>

The Boolean operators compare two real values and returns the value 1 (if true) or the value 0 (if false) as result For Boolean comparison, the math operators can be applied only on real numbers.

The Boolean operators have a different function when applied to lists. For more information see the description of Pick