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/045071.html below:

[Python-Dev] rounding problem

[Python-Dev] rounding problem [Python-Dev] rounding problemSkip Montanaro skip at pobox.com
Mon May 31 22:01:55 EDT 2004
    Norlin> the number actually comes from multiplication between 237.50 and
    Norlin> 4.762 which will get 1130.975. So it suppose to be 1130.98 isnt
    Norlin> it if it'll get rounded to 2 decimal places.

Nope.  1130.975 is not exactly representable.  In fact, it's internal
representation is slightly less that 1130.975, so rounding to two decimal
places is correctly 1130.97.

    % python
    Python 2.4a0 (#25, May 22 2004, 15:16:21) 
    [GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 1130.975
    1130.9749999999999

Skip

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