[ Arithmetic | Reference Manual | Alphabetic Index ]
+Expr1 =\= +Expr2
Succeed if the value of Expr1 is not equal to the value of Expr2.
- Expr1
- An arithmetic expression
- Expr2
- An arithmetic expression
Description
Both arguments are evaluated and their types adjusted. Then the
resulting numbers are compared. The predicate succeeds if the values of
Expr1 and Expr2 are not equal (beware of rounding errors when comparing
floats). If the system is in coroutining mode and the arguments are not
ground, this predicate delays until the expressions are fully
instantiated.
The predicate also delays when the comparison involves bounded reals,
and the compared values overlap such that the result is undecidable.
Modes and Determinism
Modules
This predicate is sensitive to its module context (tool predicate, see @/2).
Fail Conditions
fails if the value of Expr1 is equal to the value of Expr2
Exceptions
- (4) instantiation fault
- Expr1 or Expr2 is a variable (non-coroutining mode only).
- (5) type error
- Expr1 or Expr2 is not an arithmetic expression.
Examples
Success:
5 - 1 =\= 6 / 2.
1 =\= sin(pi/4). % 1 converted to 1.0
Fail:
2 + 4 =\= 2 * 3.
Error:
_ =\= 10. (Error 4)
"s" =\= 10. (Error 5)
See Also
iso_light : =\= / 2, suspend : =\= / 2, iso_strict : =\= / 2, ic : =\= / 2, is / 2, =:= / 2, >= / 2, < / 2, > / 2, =< / 2