Modest

Binary value expressions

Common form

<#left_value_expression#> <#operator#> <#right_value_expression#>

Brief

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.

Equality operations

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

Eq (Equal)

Returns true when left is equal to the right, otherwise returns false.

	a == b

NE (Not Equal)

Returns true when left is not equal to the right, otherwise returns false.

	a != b

Comparison operations

Requires that type(left) will be equal to type(right). Result type is Bool.

Valid arguments type: Integer, Float

LT (Less Than)

Returns true when left is less than right, otherwise returns false.

	a < b

GT (Greater Than)

Returns true when left is greater than right, otherwise returns false.

	a > b

LE (Greater than or Equal)

Returns true when left is greater than or equal right, otherwise returns false.

	a <= b

GE (Less than or Equal)

Returns true when left is less than or equal right, otherwise returns false.

	a >= b

Arithmetical operations

Requires that type(left) will be equal to type(right). Result type will the same as type of received arguments.

Valid arguments type: Integer, Float

Add (addition)

Returns sum of left and right arguments.

	a + b

Sub (subtraction)

Returns difference between left and right arguments.

	a - b

Mul (multiplication)

Returns multiplication result of left and right arguments.

	a * b

Div (division)

Returns the result of dividing the left argument by the right argument.

	a / b

Rem (remainder of the division)

Returns the remainder of dividing the left argument by the right argument.

	a % b

Logical and Bitwise operations

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.

Valid arguments type: Bool, Word8, Integer

Or

Returns result of or operation between left and right arguments.

	a or b

And

Returns result of and operation between left and right arguments.

	a and b

Xor

Returns result of xor operation between left and right arguments.

	a xor b

Shift operations

Result type will the same as left argument type.

Valid left argument type: Word8, Integer

Valid right argument type: Integer

Shl (Shift to the Left)

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)

Shr (Shift to the Right)

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)