is an option whose setting gives a pairwise comparison function to determine whether expressions should be considered the same.


SameTest
is an option whose setting gives a pairwise comparison function to determine whether expressions should be considered the same.
Details

- SameTest->f specifies that f[e1,e2] should be evaluated whenever it is necessary to determine whether pairs of expressions e1, e2 should be considered the same.
Examples
open all close allBasic Examples (2)
Scope (5)
Union of a set of machine-precision numbers:
Union treating roundoff errors of order 10-12 as zeros:
Alternately, use Chop:
Intersection of two sets of integers:
Intersection considering comparison modulo 3:
This matrix is antihermitian for a positive real , but AntihermitianMatrixQ gives False:
Use the option SameTest:
This matrix is symmetric for a positive real , but SymmetricMatrixQ gives False:
Use the option SameTest:
This matrix is unitary for a positive real , but UnitaryMatrixQ gives False:
Use the option SameTest:
Related Guides
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), SameTest, Wolfram Language function, https://reference.wolfram.com/language/ref/SameTest.html.
CMS
Wolfram Language. 1991. "SameTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SameTest.html.
APA
Wolfram Language. (1991). SameTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SameTest.html
BibTeX
@misc{reference.wolfram_2025_sametest, author="Wolfram Research", title="{SameTest}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/SameTest.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_sametest, organization={Wolfram Research}, title={SameTest}, year={1991}, url={https://reference.wolfram.com/language/ref/SameTest.html}, note=[Accessed: 08-August-2025]}