Hide last authors
admin 2.1 1 ==== Logical (Boolean) operators and constants ====
2
admin 5.1 3 AND:
admin 2.1 4
admin 5.1 5 |x|y|x AND y
6 |False|False|False
7 |False|True|False
8 |True|False|False
9 |True|True|True
admin 2.1 10
admin 5.1 11 If and only if both x and y are True the AND operator returns True, otherwise False.
admin 2.1 12
13
admin 5.1 14 OR:
15
16 |x|y|x OR y
17 |False|False|False
18 |False|True|True
19 |True|False|True
20 |True|True|True
21
22 If and only if both x and y are False the OR operator returns False, otherwise True.
23
24
25 NOT:
26
27 |x|NOT x
28 |False|True
29 |True|False
30
31 The NOT operator returns the opposite of the input.
32
33
34 TRUE:
35
36 The TRUE operator can be used when having an if-clause, for example: If (x<0 = TRUE) then ...
37
38
admin 2.1 39 FALSE
40
admin 5.1 41 The FALSE operator can be used when having an if-clause, for example: If (x<0 = FALSE) then ...
admin 2.1 42
admin 5.1 43
44 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.
45
admin 2.1 46 For more details have a look [[here>>https://en.wikipedia.org/wiki/Boolean_algebra#Basic_operations]]
47
48 ----
49
50 ==== Comparison operators ====
51
admin 5.1 52 ~= (equals)
admin 2.1 53
admin 5.1 54 ≠ (does not equal)
admin 2.1 55
admin 5.1 56 < (is less than)
admin 2.1 57
admin 5.1 58 ≤ (is less or equal than)
admin 2.1 59
admin 5.1 60 ~> (is greater than)
admin 2.1 61
admin 5.1 62 ≥ (is greater or equal than)
admin 2.1 63
64 With the comparison operators you can check if a data is equal, greater than, less than...then another data.
65
66 For example:
67
68 1<2 gives you TRUE
69
FirstaAnta 3.1 70 2<1 gives you FALSE
71
72 1≤1 gives you TRUE
73
74 1≤0 gives you FALSE
75
admin 2.1 76 1=1 gives you TRUE
77
78 1=2 gives you FALSE
79
FirstaAnta 3.1 80 1≠2 gives you TRUE
admin 2.1 81
FirstaAnta 3.1 82 1≠1 gives you FALSE
admin 2.1 83
84 For more details have a look [[here>>https://en.wikipedia.org/wiki/Relational_operator]]