The Constant FAIL
|
Description
|
|
•
|
FAIL is a simple name in Maple which has several special properties.
|
•
|
FAIL is used by the boolean logic to mean an unknown or undetermined value. When used inside boolean expressions with and, or and not, it behaves like standard 3-valued logic.
|
•
|
Many functions return FAIL when they are unable to compute. For example, is, testeq, etc. will return FAIL when it cannot be determined with certainty whether the value is true or false.
|
•
|
As a boolean condition in an if or while statement or `if` expression, a FAIL has the same effect as a false. I.e. the if will take the else branch and the while will stop the iteration. Notice that when a FAIL value is possible, then
|
|
if expr then a else b end if;
|
|
if not expr then b else a end if;
|
•
|
Arithmetic with FAIL is valid but limited, and the value of FAIL is contagious over the basic arithmetic operations. In other words, expressions such as 2 + FAIL, FAIL - FAIL and FAIL/FAIL will all return FAIL.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
|
|
Download Help Document
Was this information helpful?