A logical variable refers to a variable with only a true value or a false value, that is, a variable whose value can only be "1" or "0". It is the research object of logical algebra, and it is represented by "1" and "0" when studying the truth of a proposition.
Boolean variables are variables with two logical states and contain two values: true and false. If a Boolean variable is used in the expression, the integer value of 1 or 0 will be given according to the true value of the variable. Converts an integer variable into a Boolean variable. If the integer value is 0, its Boolean value is false. Conversely, if the integer value is non-zero, its Boolean value is true.
Extended data:
Correlation operation of boolean type of logical variables;
1 and Boolean have only two values: false and true. The fake serial number is 0, and the real serial number is 1 (or not).
2. The standard functions used for Boolean types are: ord (sequence number), pred (leading) and succ (succeeding). Note: False has no forerunner, but true has no successor.
3. Boolean operations (or logical operations) are used for Boolean quantities. They are: and, or and not.
4. Relational operations (or comparison operations) can also be performed on Boolean quantities. There are six relational operations: (greater than), > = (greater than or equal to), <> (not equal to).
Baidu Encyclopedia-Boolean Variable
Baidu encyclopedia-Boolean type
Baidu Encyclopedia-Logical Variable