Roman Black wrote: > > Hi Michael, yep, darn right, half the people in > the world (including me!) have been rounding wrongly > their entire lives. Very scary. There is and can only > be one correct way of rounding decimal numbers... > > Here is an example, assuming rounding to 3 decimal > places, that is 1000 combinations, from 000 to 999. > > 000 to 499 (first half), 500 to 999 (second half). > There are the first 500 combinations in the first > half, and the second 500 combination in the second > half. > > All my life I have been rounding at 555, under the > false impression that 5 is "half way" in decimal > terms... Wow. > > I asked my 26 yr old science-degreed girlfriend how > to round and she looked at me like I was stupid. > "5 or more, round up". She was taught correctly. > > Now I'm wondering if it is mainly us old-timers > from the dawn of pocket calculators age that were > taught wrong?? Any thoughts, older people?? > :o) > -Roman Cept for one minor detail, There are 999 values BETWEEN 0 and 1000. 500 IS the halfway point. 500 values below it (0 - 499) and 500 values above it (501 - 1000). Therefore, if accumulating a large series of "random" numbers and rounding using the 5 or greater rule, the result will "tend" to be too large since statistically you are using 500 possibilities below the number and 499 above the number. For most things this error would probably not be a problem, but the "round to even if 5" rule will "tend" to average out the error accumulation at the expense of complicating the rule slightly. The validity of the least significant digits does play an important role in the process, so when absolute accuracy is required use a tolerance (+/-) to exactly specify the values, and the error accumulation. For example (round to nearest 1/100): Value Tolerance Round >=5 Round to Even if 5 1.125 +/- 0.005 1.13 1.12 1.135 +/- 0.005 1.14 1.14 Repeat above 1000 times and Total 2260 2270 2260 when the tolerances say: 2260 +/- 10 or somewhere in the range of 2250 to 2270 so yes the "Round >=5" is a 'correct' answer (since it is in the possible range defined by the tolerances, even if it is at the upper limit), but the 2260 provided by the "Round to even if 5" is a 'better' answer (in some cases). Obviously this is a contrived scenerio, but if a particular sensor reported to 0.5 units of precision with +/- 0.5 units of accuracy, and you wanted to accumulate readings over a long interval, the "Round >=5" will provide an answer that is "typically" too large. If you were buying gasoline, and the pumps all rounded using the "Round >=5" rule, would you mind that you were charged for 2270 gallons instead of 2260? :-) As I stated in an earlier message in this thread, This is a very debatable subject! David W. Gulley Destiny Designs -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu