There are basically two ``flavors'' of if then statements, similar to the MAPLE:
if {\it Boolean expression} then {\it statements} else {\it more statements} end if;
and
if {\it Boolean expression} then {\it statements} end if;
What is a ``Boolean expression''? It is usually a statement using
the Boolean operators
x and y, x or y, x xor y,
not x, x in S, x eq y (for
),
x ne y (for
), x ge y (for
),
x le y (for
), and a few others.
For example,
> if 2^5 eq 32 then if> print "they're equal"; if> else print "no they're not"; if> end if; they're equal
and
> if 2^5 in [1..31] then k:=0; else k:=1; end if; > k; 1