Skip to content

Unequal

lhs != rhs evaluates to True if inequality is known or False if equality is known.

Attributes[Unequal] := {Protected}

Simple examples

Expressions known to be unequal will evaluate to True:

In[1]:= 9 != 8
Out[1]= True
Sometimes expressions may or may not be unequal, or Expreduce does not know how to test for inequality. In these cases, the statement will remain unevaluated:
In[2]:= 9*x != x*10
Out[2]= ((9*x) != (10*x))
Unequal considers Integers and Reals that are close enough to be equal:
In[3]:= tmp=5
Out[3]= 5
In[4]:= tmp != 5
Out[4]= False
In[5]:= tmp != 5.
Out[5]= False
In[6]:= tmp != 5.00000
Out[6]= False
Unequal can test for Rational inequality:
In[7]:= 4/3 != 3/2
Out[7]= True
In[8]:= 4/3 != 8/6
Out[8]= False