boolean - Maple Help

evalhf/boolean

Boolean expressions

Description

 • Boolean expressions are evaluated according to the usual Maple rules, except that no result can remain unevaluated. Every expression should evaluate to true or false.
 • Some Boolean functions have a special treatment: (a) type(...,numeric), type(...,float), and type(...,rational) will return true regardless of the argument; (b) type(...,integer) returns true if the float argument represents an exact integer.
 • Boolean variables or expressions (outside if or while statements) will have the values 1.0 (true) and 0.0 (false).
 • Equations and relations in general will be treated as Boolean expressions if encountered outside an if or while statement.

Examples

 > $x≔3:$
 > $\mathrm{evalhf}\left(x=2\right)$
 ${0.}$ (1)
 > $y≔\mathrm{true}:$
 > $\mathrm{evalhf}\left(y\right)$
 ${1.}$ (2)
 > $\mathrm{evalhf}\left(y\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{xor}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}y\right)$
 ${0.}$ (3)