Hello,
Let's assume x and y the 2 numbers.
x²=y²
x²-y²=0
(x-y)(x+y)=0
x=y or x=-y
When the variable is squared we introduce extra solutions :
we must verify if each solution is exact.
If then 2 numbers are differents, x=-y
Example: 5 and -5 ==> 5²=25 , (-5)²=25