Author mark.dickinson
Recipients dingo, giampaolo.rodola, jyasskin, loewis, mark.dickinson, rhettinger
Date 2008-12-20.20:07:02
SpamBayes Score 1.93998e-09
Marked as misclassified No
Message-id <1229803623.94.0.687600491647.issue4707@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2008-12-20 20:07:04mark.dickinsonsetrecipients: + mark.dickinson, loewis, rhettinger, giampaolo.rodola, jyasskin, dingo
2008-12-20 20:07:03mark.dickinsonsetmessageid: <1229803623.94.0.687600491647.issue4707@psf.upfronthosting.co.za>
2008-12-20 20:07:03mark.dickinsonlinkissue4707 messages
2008-12-20 20:07:02mark.dickinsoncreate