[Next] [Prev] [Right] [____] [Up] [Index] [Root]
Booleans

Booleans

The category Bool contains the Boolean structure, which can be constructed with the function Booleans() . This is rarely done explicitly, but the two elements of the Boolean structure, true and false , are frequent return values from certain intrinsic operations. Any intrinsic function whose name begins with `Is' returns a Boolean, and so do the comparison operators eq, ne, gt, ge, lt, le.

Moreover, these operators operate on Boolean values and return a Boolean result: or, xor, and, not

Given the Boolean structure B, the function Random(B) returns a random Boolean value.

Example

> B:=Booleans();
> print B;
Boolean Structure
> print Random(B);
false

> print IsPrime(31); true > print 5 lt 32 or Sqrt(5) ge 13; true

[Next] [Prev] [Right] [____] [Up] [Index] [Root]