Bugs item #1687314, was opened at 2007-03-24 11:02
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Gust1 (gust1)
Assigned to: Nobody/Anonymous (nobody)
Summary: Round funcion

Initial Comment:
I don't quite know if it is a bug, but when I do this in the interpreter (see 
blow) the third return is not what i wanted.

>>> round(5.5, 3)
5.5
>>> round(5.5555555555, 3)
5.556
>>> round(5.5555555555, 2)
5.5599999999999996

I created a function to solve this. It can be found attached to this report.

I'm sorry but I'm not English so I don't speak this language very good.

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2007-03-24 11:37

Message:
Logged In: YES 
user_id=849994
Originator: NO

This is invalid. See
http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to