Class Bool

Bool is reprensentation of boolean value, having either true or false as value.

Methods


(bool) copy

Creates a copy of source.

Return value

Example

main
  bool b1               // b1 == false
  bool b2 = b1.copy     // b2 == false
                

(bool) <bool b1> and <bool b2>

Test whether both parameters are true.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = true
  bool result = b1 and b2   // result == false

  b1 = true
  result = b1 and b2        // result == true
                

(bool) <bool b1> or <bool b2>

Test whether either parameter is true.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = true
  bool result = b1 or b2   // result == true

  b2 = false
  result = b1 or b2        // result == false
                

(bool) <bool b1> xor <bool b2>

Test whether either, but not both of the parameters are true.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = true
  bool result = b1 xor b2  // result == true

  b1 = true
  result = b1 xor b2       // result == false
                

(bool) not <bool b>

Negates bool provided as parameter.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = not b1          // b2 == true
                

(bool) true

Literal defining true value.

Return value

Example

main
  bool b = true             // b == true
                

(bool) false

Literal defining false value.

Return value

Example

main
  bool b = false             // b == false
                

(bool) <bool b1> == <bool b2>

Test whether parameters have the same value.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = true
  bool result = b1 == b2  // result == false
              

(bool) <bool b1> != <bool b2>

Test whether parameters have different values.

Parameters

Return value

Example

main
  bool b1 = false
  bool b2 = true
  bool result = b1 != b2  // result == false