Go back to previous page
Forum URL: http://www.cut-the-knot.org/cgi-bin/dcforum/forumctk.cgi
Forum Name: This and that
Topic ID: 80
Message ID: 1
#1, RE: Rounding Rules
Posted by alexb on Jan-17-01 at 10:39 AM
In response to message #0
There are three distinct rounding methods:


Rounding up
Rounding down
Rounding to the nearest something

In addition, in computer programming, the meaning of the above may very well depend on the manner in which numbers are stored in a particular computer memory. This is just to say that the answer to your question may not be unique and should not be treated as altogether trivial.

When you round up, you seek the nearest whole number greater than the given one: for 2.4 it's 3, for -2.4 it's -2.

When you round down, you seek the nearest whole number less than the given one: for 2.4 it's 2, for -2.4 it's -3.

When you round to the nearest whole number, you seek the whole number that is nearest to the given one: for 2.4 it's 2, for -2.4 it's -2.

With the rounding to the nearest whole number, numbers that are the sum (whole number + half) pose a peculiar problem. By convention, if (whole number) is even the (half) is dropped. Otherwise, the (whole number) is increased by 1 if the number is positive and decreased by 1 if it's negative. For example, rounding 2.5 gives 2, rounding 3.5 gives 4, rounding -2.5 gives -2, rounding -3.5 gives -4.

All the best,
Alexander Bogomolny