projog

3.29. X=\=Y - numeric inequality test.

Succeeds when the number argument X is not equal to the number argument Y.

Examples

?- 1=\=1.

no

?- 1.5=\=3.0/2.0.

no

?- 6*6=\=9*4.

no

?- 1=\=2.

yes

?- 1+1=\=1-1.

yes

?- X=1, Y=1, X=\=Y.

no

?- X=1, Y=2, X=\=Y.
X = 1
Y = 2

yes

?- 7.0=\=7.0.

no

?- 7=\=7.0.

no

?- 7.0=\=7.

no

?- 7=\=7.

no

?- 7.1=\=7.1.

no

?- 7.0=\=7.1.

yes

?- 7.1=\=7.2.

yes

?- 7.2=\=7.1.

yes

?- 7.1=\=7.

yes

?- 7=\=7.1.

yes

?- -7=\=-7.

no

?- 7=\=-7.

yes

?- -7=\=7.

yes

?- 9223372036854775806 =\= 9223372036854775807.

yes

?- 9223372036854775807 =\= 9223372036854775806.

yes

?- 9223372036854775807 =\= 9223372036854775807.

no

?- 9223372036854775806 =\= 9223372036854775806.

no

?- -9223372036854775808 =\= -9223372036854775807.

yes

?- -9223372036854775807 =\= -9223372036854775808.

yes

?- -9223372036854775808 =\= -9223372036854775808.

no

?- -9223372036854775807 =\= -9223372036854775807.

no

Note that due to loss of precision when comparing decimal fractions the following queries evaluate to false:

?- 9223372036854775806 =\= 9223372036854775807.0.

no

?- 9223372036854775806.0 =\= 9223372036854775807.

no

?- 9223372036854775806.0 =\= 9223372036854775807.0.

no