All binary operations require that type(left) == type(right) (Only exception - ShL & ShR operations).
<#left_value_expression#> <#operator#> <#right_value_expression#>
Operation | Code Example | Valid argument types | Result type | Comment |
---|---|---|---|---|
Eq NE |
a == b a != b |
Bool, Word8, Char, Integer, Float, Array, Record, Pointer | Bool | Arrays & Records can be compared (by value) |
LT GT LE GE |
a < b a > b a <= b a >= b |
Integer, Float | Bool | |
Add Sub Mul Div Rem |
a + b a - b a * b a / b a % b |
Integer, Float | type(left) | |
Or And Xor |
a or b a and b a xor b |
Bool, Word8, Integer | type(left) | |
Shl Shr |
a << b a >> b |
Word8, Integer | type(left) | Type of left & right arguments can be different. Only left argument can be Word8. |
Requires that type(left) will be equal to type(right). Result type is Bool.
Valid arguments type: Bool, Word8, Char, Integer, Float, Array, Record, Pointer
Returns true when left is equal to the right, otherwise returns false.
a == b
Returns true when left is not equal to the right, otherwise returns false.
a != b
Requires that type(left) will be equal to type(right). Result type is Bool.
Returns true when left is less than right, otherwise returns false.
a < b
Returns true when left is greater than right, otherwise returns false.
a > b
Returns true when left is greater than or equal right, otherwise returns false.
a <= b
Returns true when left is less than or equal right, otherwise returns false.
a >= b
Requires that type(left) will be equal to type(right). Result type will the same as type of received arguments.
Returns sum of left and right arguments.
a + b
Returns difference between left and right arguments.
a - b
Returns multiplication result of left and right arguments.
a * b
Returns the result of dividing the left argument by the right argument.
a / b
Returns the remainder of dividing the left argument by the right argument.
a % b
Is Logical when arguments type is Bool, otherwise is Bitwise. Requires that type(left) will be equal to type(right). Result type will the same as type of received arguments.
Returns result of or operation between left and right arguments.
a or b
Returns result of and operation between left and right arguments.
a and b
Returns result of xor operation between left and right arguments.
a xor b
Result type will the same as left argument type.
Valid right argument type: Integer
Left must be Word Allow that type(left) will not be equal to type(right).
a << b
type(a) can be different from type(b)
Left must be Word Allow that type(left) will not be equal to type(right).
a >> b
type(a) can be different from type(b)