I was under the impression that =
is an assignment, ==
is a numeric comparison, and ===
is a symbolic comparison (as well as in some o
One important difference is that ===
always returns True
or False
. ==
can return unevaluated (which is why it's useful for representing equations.)
In[7]:= y == x^2 + 1
Out[7]= y == 1 + x^2
In[8]:= y === x^2 + 1
Out[8]= False
There are some interesting cases where ==
returns unevaluated that are worth being aware of while programming. For example:
In[10]:= {} == 1
Out[10]= {} == 1
which can affect things like If[foo=={},
.