Question 1198927
to find the difference, you would subtract the smaller number from the larger number.


if x is larger than 9, then x - (x - 9) = 9


if x is smaller than 9, then x - (9-x) = 2x - 9


example 1:
x is equal to 5
since x is less than 9, you get x - (9-x) becomes 5 - (9-5) which becomes 5 - 4 which becomes 1.


example 2:
x is equal to 15
since x is larger than 9, you get x - (x - 9) which becomes 15 - (15 - 9) which becomes 15 - 6 which becomes 9.


you can also use an absolute value expression.


youc could get x - |x - 9|
if (x - 9) is positive, then this becomes x - (x - 9)
if (x - 9) is negative, then this becomes x + (x - 9)
note that, if x = 15, then (x - 9) is positive and if x = 5, then (x - 9) is negative.
you would get 15 - (15 - 9) = 9 because (x - 9) is positive.
you would get 5 + (5 - 9) = 1 because (x - 9) is negative.


let me know if you have any questions.
theo