There are, as always in computer software development, a number of ways. The first two off the top of my head are
1. Use the absolute function i.e. abs(-1) returns 1
2. Multiply the result of the subtraction by -1 i.e.
answer = 9 - 10
if answer < 0 then
answer = answer * -1
endif
HTH
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.