Larry wrote:
> Maybe one more small refinement? The way I learned to round is to
round to nearest (as your function does), except where the least
significant digit is 5. In that case, one should round even. For
example:
>
> 1.4 rounds to 1
> 1.6 rounds to 2
> 1.5 rounds to 2
> 2.5 rounds to 2
> 3.5 rounds to 4
>
> This extra step helps avoid bias when rounding a sequence of numbers
which end in the digit 5. Otherwise the sum of the rounded sequence is
not equal to the sum of the unrounded sequence. Another way of
avoiding bias is to randomly round up or down when the last digit is 5.
I think your system might be mistaken as it doesn't take into account
the rounding of xxxx.0
1.0 1 < This is part of the sequence.
1.1 1
1.2 1
1.3 1
1.4 1
1.5 2
1.6 2
1.7 2
1.8 2
1.9 2
etc
Of course, I could be mistaken.
Andrew Martin
Fractional disagreement, integral agreement...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
-><-