On Tue, Feb 15, 2011 at 4:49 PM, Hans-Peter Jansen <h...@urpla.net> wrote:
> Hi,
>
> while I usually cope with the woes of floating point issues, this is
> one, that I didn't expect:
>
>>>> round(2.385, 2)
> 2.3799999999999999
>
> Doesn't the docs say, it's rounded up for this case?
>
> <quote>
> Values are rounded to the closest multiple of 10 to the power minus n;
> if two multiples are equally close, rounding is done away from 0
> </quote>
>
> Well, that one is clearly rounding down.
>
> What's up, eh, down here?

Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 2.385
2.3849999999999998

Looks to me like it's working as expected...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to