SameQ—Wolfram Language Documentation (original) (raw)

BUILT-IN SYMBOL

SameQ

lhs===rhs

yields True if the expression lhs is identical to rhs, and yields False otherwise.

Background & Context

Examples

open allclose all

Basic Examples (2)

Test whether two expressions are identically the same:

== remains symbolic unless literal values are given:

Full form:

Scope (4)

Test equivalence of strings:

Numbers in different representations are not the same:

== 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:

Applications (1)

Make a Kronecker delta (identity) tensor:

Properties & Relations (4)

SameQ accepts any number of arguments:

SameQ[expr1,expr2,…] gives True if SameQ[expri,exprj] is True for all i and j:

If one of the expressions is not the same as the others, then SameQ gives False:

SameQ[expr1,expr2] is equivalent to UnsameQ[expr1,expre2]:

SameQ[…] and UnsameQ[…] are not equivalent for an argument count other than two:

SameQ[] and SameQ[expr] always give True:

History

Introduced in 1988 (1.0)

Wolfram Research (1988), SameQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SameQ.html.

Text

Wolfram Research (1988), SameQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SameQ.html.

CMS

Wolfram Language. 1988. "SameQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SameQ.html.

APA

Wolfram Language. (1988). SameQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SameQ.html

BibTeX

@misc{reference.wolfram_2024_sameq, author="Wolfram Research", title="{SameQ}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/SameQ.html}", note=[Accessed: 31-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_sameq, organization={Wolfram Research}, title={SameQ}, year={1988}, url={https://reference.wolfram.com/language/ref/SameQ.html}, note=[Accessed: 31-December-2024 ]}