[ Arithmetic | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

# +Expr1 =:= +Expr2

Succeed if the value of Expr1 is 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 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

- =:=(+, +) is semidet

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

### Fail Conditions

fails if the value of Expr1 is not 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 - 2 =:= 6 / 2.
       1 =:= sin(pi/2).        % 1 converted to 1.0
       Fail:
       2 + 3 =:= 2 * 3.
       Error:
       _ =:= 0.                   (Error 4)
       "s" =:= 0.                 (Error 5)

## See Also

colgen : =:= / 2, suspend : =:= / 2, ic : =:= / 2, eplex : =:= / 2, is / 2, < / 2, =\= / 2, >= / 2, =< / 2, > / 2