Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Difference rather than subtract
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Fashoomp




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Tue Feb 26, 2008 5:58 pm   Post subject: RE:Difference rather than subtract

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




PostPosted: Tue Feb 26, 2008 6:01 pm   Post subject: Re: Difference rather than subtract

Thanks.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: