Logic
Logical (Boolean) operators and constants
AND:
x | y | x AND y |
False | False | False |
False | True | False |
True | False | False |
True | True | True |
If and only if both x and y are True the AND operator returns True, otherwise False.
OR:
x | y | x OR y |
False | False | False |
False | True | True |
True | False | True |
True | True | True |
If and only if both x and y are False the OR operator returns False, otherwise True.
NOT:
x | NOT x |
False | True |
True | False |
The NOT operator returns the opposite of the input.
TRUE:
The TRUE operator can be used when having an if-clause, for example: If (x<0 = TRUE) then ...
FALSE
The FALSE operator can be used when having an if-clause, for example: If (x<0 = FALSE) then ...
With the logical operators you can for example connect an if condition: If number > 5 AND number < 10 is true then... This if-clause checks if the number is between 6 and 9.
For more details have a look here
Comparison operators
= (equals)
≠ (does not equal)
< (is less than)
≤ (is less or equal than)
> (is greater than)
≥ (is greater or equal than)
With the comparison operators you can check if a data is equal, greater than, less than...then another data.
For example:
1<2 gives you TRUE
2<1 gives you FALSE
1≤1 gives you TRUE
1≤0 gives you FALSE
1=1 gives you TRUE
1=2 gives you FALSE
1≠2 gives you TRUE
1≠1 gives you FALSE
For more details have a look here