User Guide
• Logical operators - and, or, xor, implies, not
• Logical names - true, false, FAIL
The statement sequences (statement_sequence1, statement_sequence2, ...,
statement_sequenceN) can be any sequence of Maple statements, including
if statements.
The elif clauses are optional. You can specify any number of elif clauses.
The else clause is optional.
Simple if Statements
The simplest if statement has only one conditional expression.
if conditional_expression then
statement_sequence
end if;
>
If the conditional expression evaluates to true, the sequence of statements
is executed. Otherwise, Maple immediately exits the if statement.
For example:
x := 1173:>
if not isprime(x) then
ifactor(x);
end if;
>
else Clause
In a simple if statement with an else clause, if the evaluation of the conditional
expressions returns false or FAIL, Maple executes the statement sequence
in the else clause.
8.2 Flow Control • 323