Message78124
> Is your guess for round(25.0,
> -1)==30.0 that 25.0*(1/10.0) is slightly more than 2.5 on some
> systems?
Yes, something like that. I don't think it's feasible to make round
perfectly correct (for floats) in all cases without implementing some
amount of multiple precision code. But I think we can and should
rewrite the code in such a way that it has a pretty good chance of
returning correct results in common cases. Small powers of 10 can be
computed exactly (up to 10**22, I think), in contrast to reciprocals of
powers of 10.
I'll work up a patch for round(int, int) -> int, so that at least we
have
the option of fixing this for 3.0.1 *if* there's general agreement that
that's the right way to go. Seems like a python-dev discussion might be
necessary to determine that. |
|
Date |
User |
Action |
Args |
2008-12-20 20:07:04 | mark.dickinson | set | recipients:
+ mark.dickinson, loewis, rhettinger, giampaolo.rodola, jyasskin, dingo |
2008-12-20 20:07:03 | mark.dickinson | set | messageid: <1229803623.94.0.687600491647.issue4707@psf.upfronthosting.co.za> |
2008-12-20 20:07:03 | mark.dickinson | link | issue4707 messages |
2008-12-20 20:07:02 | mark.dickinson | create | |
|