Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Expressions > Testing Expressions >
Mathematica > Core Language > Procedural Programming > Conditionals > Testing Expressions >

SameQ

lhsSameQrhs
yields True if the expression lhs is identical to rhs, and yields False otherwise.
  • SameQ requires exact correspondence between expressions, except that it still considers Real numbers equal if they differ in their last binary digit.
  • e1SameQe2SameQe3 gives True if all the e_i are identical.
Test whether two expressions are identically the same:
Equal remains symbolic unless literal values are given:
Full form:
Test whether two expressions are identically the same:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Equal remains symbolic unless literal values are given:
In[3]:=
Click for copyable input
Out[3]=
 
Full form:
In[1]:=
Click for copyable input
Out[1]=
Test equivalence of strings:
Numbers in different representations are not the same:
Equal nevertheless treats them as equal:
Approximate numbers that differ in their last bit are still considered identical:
Test whether multiple expressions are all the same:
Make a Kronecker delta (identity) tensor:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team