Syntax

x <> y_unequal(x, y)

Description

x <> y defines an inequality.

x <> y is equivalent to the function
call _unequal(x, y).

The operator <> returns a symbolic
expression representing an inequality.

The resulting expression can be evaluated to TRUE or FALSE by
the function bool.
It also serves as control conditions in if, repeat, and while statements. In all these cases,
testing for equality or inequality is a purely syntactical test. For
example, bool(0.5 <> 1/2) returns TRUE although
both numbers coincide numerically. Further, Boolean expressions can
be evaluated to TRUE, FALSE,
or UNKNOWN by
the function is.
Tests using is semantically
compare x and y applying mathematical
considerations.

Inequalities have two operands: the left side and the right
side. Use lhs and rhs to extract these
operands.

The boolean expression not x = y is always
converted to x <> y.

The expression not x <> y is always
converted to x = y.

Examples

Example 1

In the following example, note the difference between syntactical
and numerical equality. The numbers 1.5 and coincide
numerically. However, 1.5 is
of domain type DOM_FLOAT, whereas is
of domain type DOM_RAT.
Consequently, they are not regarded as equal in the following syntactical
test: