Computer Science Canada Rounding |
Author: | Neo [ 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. |
Author: | zylum [ Tue Nov 23, 2004 11:18 pm ] |
Post subject: | |
first you would want to divide by ten, then round and then multiply by ten again ![]() |
Author: | Neo [ Tue Nov 23, 2004 11:31 pm ] |
Post subject: | |
Thanks, Im an idiot. |