up previous next
Bool01

Convert a boolean to an integer

Syntax
Bool01(B: BOOL): INT

Description
This function converts a boolean to an integer using the convention: false becomes 0, and true becomes 1.

Example
/**/  Id4 := matrix([[Bool01(i=j) | i in 1..4] | j in 1..4]);
/**/  Id4;
matrix(QQ,
 [[1, 0, 0, 0],
  [0, 1, 0, 0],
  [0, 0, 1, 0],
  [0, 0, 0, 1]])