===
)
SameQ
[x, y]x === y
True
if x and y are structurally identical. Commutative properties apply, so if x === y then y === x.
SameQ
requires exact correspondence between expressions, expect that it still considers Real
numbers equal if they differ in their last binary digit.True
if all the ei's are identical.SameQ[]
and SameQ[expr]
always yield True
.Any object is the same as itself:
a === a
Degenerate cases of SameQ
showing off how you can chain ===
:
SameQ[a] === SameQ[] === True
Unlike Equal
, SameQ
only yields True
if x and y have the same type:
{1==1., 1===1.}
2./9. === .2222222222222222`15.9546
The comparison consider just the lowest precision
.2222222`6 === .2222`3
Notice the extra decimal in the rhs. Because the internal representation,
$0.222`3$ is not equivalent to $0.2222`3$:
.2222222`6 === .222`3
15.9546 is the value of $MaxPrecision