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

Username:   Password: 
 RegisterRegister   
 Rounding
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Neo




PostPosted: Tue Nov 23, 2004 10:20 pm   Post subject: Rounding

How would I round a number to the nearst ten. Say I had 12 I want it to be changed to 10 or say I had 115 then I would want it to be 120. I looked in turing reference and can only find the floor and ceiling function to round a real number to an int.
Sponsor
Sponsor
Sponsor
sponsor
zylum




PostPosted: Tue Nov 23, 2004 11:18 pm   Post subject: (No subject)

first you would want to divide by ten, then round and then multiply by ten again Wink
Neo




PostPosted: Tue Nov 23, 2004 11:31 pm   Post subject: (No subject)

Thanks, Im an idiot.
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: