![]() |
Examples 7.2.2:
|
The features of the pervasive class BIT are used in individual examples below.
The following two code fragments are identical in meaning although the first will usually be more efficient (dependent upon the implementation).
Note that truth_value.not is the identical expression to ~truth_value.
In practice it is not often necessary to use an equality test on two truth values. However, this is provided for completeness as -
which is, of course, identical to
Where it is necessary to satisfy two conditions simultaneously before taking some action then the following could be written -
which uses a case construction as an alternative to an if-statement.
The other canonical logical operator could be used in expressing the following version of De Moivre's theorem.
where A and B are truth values.
![]() |
Specification Index | ![]() |
Language Index | ![]() |
Section 7 Index |
Comments
or enquiries should be made to Keith Hopper. Page last modified: Tuesday, 23 May 2000. |
![]() |