negated equality test operator
sollya_obj_t sollya_lib_cmp_not_equal(sollya_obj_t, sollya_obj_t)
expr1 != expr2 : (any type, any type) -> boolean
- expr1 and expr2 represent expressions
- The operator != evaluates to true iff its operands expr1 and
expr2 are syntactically unequal and both different from error,
constant expressions that are not constants and that evaluate to two
different floating-point number with the global precision prec or
polynomials that are unequal while automatic expression simplification
is activated. The user should be aware of the fact that because of
floating-point evaluation, the operator != is not exactly the
same as the negation of the mathematical equality. Further, expressions
that are polynomials may not be structurally equal when != evaluates
to false; in order to obtain purely structural tests, the user should
deactivate automatic simplification using autosimplify.
Following the IEEE 754 standard, NaN compares unequal to itself, even though
this corresponds to a case when expr1 and expr2 are syntactically equal
and different from error. Accordingly, the interval [NaN, NaN] compares
unequal to itself.
Note that the expressions !(expr1 != expr2) and expr1 == expr2
do not always evaluate to the same boolean value. See error for details.
- Notice that @NaN@, [@NaN, @NaN@] and error have special properties
with respect to comparison for equality with == and !=. See
documentation for == for a detailed description.
> "Hello" != "Hello";
> "Hello" != "Salut";
> "Hello" != 5;
> 5 + x != 5 + x;
> 1 != exp(0);
> asin(1) * 2 != pi;
> exp(5) != log(4);
> sin(pi/6) != 1/2 * sqrt(3);
> prec = 12;
The precision has been set to 12 bits.
> 16384.1 != 16385.1;
> NaN != NaN;
> [NaN,NaN] != [NaN,NaN];
> error != error;
> p = x + x^2;
> q = x * (1 + x);
> autosimplify = on;
Automatic pure tree simplification has been activated.
> p != q;
> autosimplify = off;
Automatic pure tree simplification has been deactivated.
> p != q;
See also: ==
Go back to the list of commands