Message195686
I agree with Oscar about sum for decimal.Decimal. The *ideal* sum for Decimal instances would return the correctly rounded result (i.e., the exact result, rounded to the current context just once using the current rounding mode). It seems wrong to give a guarantee of behaviour that's in conflict with this ideal.
IEEE 754 recommends a 'sum' operation (in section 9.4, amongst other reduction operations), but doesn't go so far as to either require or recommend that the result be correctly rounded. Instead, it says "Implementations may associate in any order or evaluate in any wider format.", and then later on, "Numerical results [...] may differ among implementations due to the precision of intermediates and the order of evaluation." It certainly *doesn't* specify that the results should be as though the context precision and rounding mode were used for every individual addition. |
|
Date |
User |
Action |
Args |
2013-08-20 12:43:28 | mark.dickinson | set | recipients:
+ mark.dickinson, terry.reedy, gregory.p.smith, ronaldoussoren, belopolsky, pitrou, agthorr, christian.heimes, stutzbach, steven.daprano, sjt, ethan.furman, tshepang, oscarbenjamin, vajrasky |
2013-08-20 12:43:28 | mark.dickinson | set | messageid: <1377002608.43.0.244520856137.issue18606@psf.upfronthosting.co.za> |
2013-08-20 12:43:28 | mark.dickinson | link | issue18606 messages |
2013-08-20 12:43:27 | mark.dickinson | create | |
|