Computer Science Canada

Difference rather than subtract

Author:  Fashoomp [ Tue Feb 26, 2008 5:55 pm ]
Post subject:  Difference rather than subtract

I am comparing a bunch of numbers against each other to calculate a distance. However, I do not want a negative answer. I want to know how if I enter a number, and then a second number, it will find the difference between the 2, so it doesn't matter whether I enter the bigger number first or second.

I know how to do it with just 2, but not when I'm comparing lots of numbers.

Author:  Clayton [ Tue Feb 26, 2008 5:58 pm ]
Post subject:  RE:Difference rather than subtract

Turing:
put abs (7-87)
put abs (87-7)

Author:  Fashoomp [ Tue Feb 26, 2008 6:01 pm ]
Post subject:  Re: Difference rather than subtract

Thanks.


: