The boolean operators implemented in Kuifje.
The And operator is used to verify if two conditions are true at the same time.
Program:
x <- uniform [1, 2, 3];
y = (x < 3) && (x > 1);
Output or variable y:
Probability of the distribution happen | Distribution | Value |
---|---|---|
1.00 | 0.67 | False |
0.33 | True |
The Or operator is used to verify if at least one of two conditions are valid.
Program:
x <- uniform [1, 2, 3];
y = (x < 2) || (x > 2);
Output or variable y:
Probability of the distribution happen | Distribution | Value |
---|---|---|
1.00 | 0.33 | False |
0.67 | True |
The Not operator negates a boolean, it can be used to verify the opposite of a condition.
Program:
x <- uniform [1, 2, 3];
y = (x < 3) && (x > 1);
z = ~y;
Output or variable y:
Probability of the distribution happen | Distribution | Value |
---|---|---|
1.00 | 0.67 | False |
0.33 | True |
Output or variable z:
Probability of the distribution happen | Distribution | Value |
---|---|---|
1.00 | 0.33 | False |
0.67 | True |