Question: how to calculate the absolute difference between two numbers?
Answer: If just the difference between two numbers want to be observed, then you should get the positive value and define the difference between two numbers as the absolute value of their difference, obtaining always the positive value. In the -5 and 2 example the difference would be |−5−2|=|2−(−5)|=7.