Re: RE: follow up II - newbie questions, sum over range, rounding of special problematic values



Here is a summary of the results from rounddown. Cells are set to 
display 17 decimal places.


input   0.24999999999999997     
digits  rounddown               expected
1       0.20000000000000001     0.20000000000000001
2       0.25000000000000000     0.23999999999999999
3       0.25000000000000000     0.24900000000000000
4       0.25000000000000000     0.24990000000000001
5       0.25000000000000000     0.24998999999999999
6       0.25000000000000000     0.24999900000000000
7       0.25000000000000000     0.24999990000000000
8       0.25000000000000000     0.24999999000000001
9       0.25000000000000000     0.24999999900000000
10      0.25000000000000000     0.24999999989999999
11      0.25000000000000000     0.24999999999000000
12      0.25000000000000000     0.24999999999899999
13      0.25000000000000000     0.24999999999990000
14      0.25000000000000000     0.24999999999999001
15      0.25000000000000000     0.24999999999999900
16      0.25000000000000000     0.24999999999999989
17      0.24999999999999997     0.24999999999999997

For digits 2 through 16, rounddown is rounding up instead of down.


Here are the results for roundup:

input   0.24999999999999997     
digits  roundup                 expected
1       0.29999999999999999     0.29999999999999999
2       0.25000000000000000     0.25000000000000000
3       0.25000000000000000     0.25000000000000000
4       0.25000000000000000     0.25000000000000000
5       0.25000000000000000     0.25000000000000000
6       0.25000000000000000     0.25000000000000000
7       0.25000000000000000     0.25000000000000000
8       0.25000000000000000     0.25000000000000000
9       0.25000000000000000     0.25000000000000000
10      0.25000000000000000     0.25000000000000000
11      0.25000000000000000     0.25000000000000000
12      0.25000000000000000     0.25000000000000000
13      0.25000000000000000     0.25000000000000000
14      0.25000000000000000     0.25000000000000000
15      0.25000000000000000     0.25000000000000000
16      0.24999999999999989     0.25000000000000000
17      0.24999999999999997     0.24999999999999997

For 16 digits, roundup is rounding down instead of up.


Have I misunderstood something? These look like bugs to me.


-- 
Steve


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]