piclist 2001\06\02\074137a >
www.piclist.com/techref/index.htm?key=brain+burp+rounding
BY : David W. Gulley email (remove spam text)

Kyle Stemen wrote:
{Quote hidden}

Actually, you lose no precision or accuracy, if your premise is that the
To demonstrate this take the average of the groups above:
0.5 + 1.5 + ... 9.5 = 50/10 = 5   (the list of numbers)
0 + 2 + 2 + ... 10  = 50/10 = 5   (Rounded to Even)
1 + 2 + 3 + ... 10  = 55/10 = 6   (Rounded Up)

Rounding by adding 0.5 to x.5 results in a number that is different from
the original by the same amount that subtracting 0.5 from x.5 would
yield.

In other words, rounding 0.5 to 0 adds no more imprecision than rounding
to 1.

Having now stated that Round to Even does not increase the imprecision,
I must also state that neither does it does it increase the precision.
What Round to Even accomplishes is most valuable when accumulating a set
of values, since it tends to center the accumulated result in the range
of accuracy, while the Round Up method approaches the upper bound of the
accuracy range, and performing a truncate forces the result to the lower
bound of the accuracy range.

The original question in this thread was (essentially):
"How do you round a number?"

When I encounter a task that requires rounding, I first consider what
the appropriate method might be and then implement the most reasonable
solution.
For some jobs, I might just truncate; for others add 0.5 and truncate
(which is Round Up); but, if the rounded values are being accumulated I
(may) use the Round to Even methodology.

But, if you ask me "how do you round a number," my reply is round up if
greater than 0.5, round down if less than 0.5 and if exactly x.5, round
up if previous digit odd, round down if previous digit even.

David W. Gulley
Destiny Designs

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

<3B18D038.96CBC8B8@destinydesigns.com> 7bit