Message71281
Hit submit too soon; sorry...
But it would be reasonable to aim for correctly rounded results when the
second argument to round is not too large (less than 22 in absolute
value, for example), so that 10**abs(n) is exactly representable as a
double. I think this should be easy when n is negative (use fmod to
compute the remainder, and subtract the remainder from the original
number to round down, or add (10**-n - remainder) to round up, and a
little bit more involved when n is positive.
Note that the 3.x version will need to be slightly different, so that it
does round-half-to-even instead of round-half-away-from-zero.
I think that while these changes could be considered bugfixes they're
not essential, so should be put off until 2.7/3.1. |
|
Date |
User |
Action |
Args |
2008-08-17 15:35:36 | mark.dickinson | set | recipients:
+ mark.dickinson, gboutsioukis |
2008-08-17 15:35:36 | mark.dickinson | set | messageid: <1218987336.41.0.842242365605.issue1869@psf.upfronthosting.co.za> |
2008-08-17 15:35:35 | mark.dickinson | link | issue1869 messages |
2008-08-17 15:35:35 | mark.dickinson | create | |
|