4.10 Logical Operator

The usage of the three logical operators (conjunction, disjunction, exclusive or) is shown in Table 4.7. In addition the results of the combination of boolean values (1:true, 0:false) are shown in Table 4.8,Table 4.9 and Table 4.10.

Table 4.7: Summary of logical operators

Description

Format

Example

Conjunction

$bool_1 \& \&  bool_2$

"abc"=="abc" && "xyz"=="abc" (0b0)

Disjunction

$bool_1 || bool_2$

"abc"=="abc" || "xyz"=="abc" (0b1)

Exclusive or

$bool_1$ \^{}\^{} $bool_2$

"abc"=="abc" ^^ "xyz"=="abc" (0b1)


The results of the examples are shown in parentheses (the content is shown using constant numbers).

Table 4.8: Conjunction

$bool_1$

$bool_2$

Result

1

1

1

1

0

0

0

1

0

0

0

0

null

1

null

null

0

0

null

null

null

Table 4.9: Disjunction

$bool_1$

$bool_2$

Result

1

1

1

1

0

1

0

1

1

0

0

0

null

1

1

null

0

null

null

null

null

Table 4.10: Exclusive Or

$bool_1$

$bool_2$

Result

1

1

0

1

0

1

0

1

1

0

0

0

null

1

null

null

0

null

null

null

null