Is there a simple way mathematically to convert $X$ and $Y$ into $1$ where $X=Y$, and $0$ where $X \neq Y$

55 Views Asked by At

Given two integers, $X$ and $Y$, is there a simple mathematical expression that can be performed on them that resolves to $1$ when $X=Y$ and to $0$ when $X \neq Y$?

Something that can be expressed computationally without a conditional. Additions, subtractions, multiplications, divisions, etc in a computational expression that will resolve to $1$ if $X=Y$ and $0$ if $X \neq Y$. Essentially a test for equality that can be used in a computational expression without using an actual conditional statement.