A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-May/045059.html below:

[Python-Dev] rounding problem

[Python-Dev] rounding problem [Python-Dev] rounding problemGary Herron gherron at islandtraining.com
Mon May 31 21:19:00 EDT 2004
On Monday 31 May 2004 06:08 pm, Norlin Abd Rahim wrote:
> Hi,
>
> I'm using python with zope. I used _.round and it seems like it is look
> unstable. For example if i have one number, 1130.975 and rounded it to 2
> decimal places, it will be 1130.97 and not 1130.98. But for certain numbers
> it will rounded correctly if the last digit is 5. I even used fixedpoint.py
> but still i've got the same problem. This applies only to numbers that have
> digit 5 after the decimal places that needs to be rounded.
>
> Any idea why?
>
> TIA

Perhaps the last digit is 5 only because the printing rounded
...4999... or some such up to 5.  Unless you KNOW that the number is
exactly 1130.975 (in its internal representation) then you must
consider this as a possibility.

Gary Herron



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4