FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Math Division Problem? · Issue #40052 · python/cpython · GitHub

Repository navigation

Math Division Problem? #40052

Closed
Closed

Description

mannequin
BPO 919498
Nosy @sjoerdmullender

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2004-03-19.14:23:05.000>
created_at = <Date 2004-03-19.13:20:25.000>
labels = ['interpreter-core', 'invalid']
title = 'Math Division Problem?'
updated_at = <Date 2004-03-19.14:23:05.000>
user = 'https://bugs.python.org/grasp81'

bugs.python.org fields:

activity = <Date 2004-03-19.14:23:05.000>
actor = 'sjoerd'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2004-03-19.13:20:25.000>
creator = 'grasp81'
dependencies = []
files = []
hgrepos = []
issue_num = 919498
keywords = []
message_count = 2.0
messages = ['20270', '20271']
nosy_count = 2.0
nosy_names = ['sjoerd', 'grasp81']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue919498'
versions = ['Python 2.3']

Activity

  1. grasp81 commented on Mar 19, 2004

    grasp81mannequin
    MannequinAuthor

    Using
    Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC
    v.1200 32 bit (Intel)] on win32

    A mere real division resulted in this:
    >>> 7.0/3
    2.3333333333333335

    Mind the trailing '5'. Did I miss my University classes too
    much? ;)

    Amazingly,
    >>> 4.0/3
    1.3333333333333333
    - works OK.
  2. sjoerdmullender commented on Mar 19, 2004

    Member

    Logged In: YES
    user_id=43607

    This is not a bug.

    Binary floating point cannot represent decimal fractions exactly,
    so some rounding always occurs (even in Python 1.5.2).

    What changed is that Python 2.0 shows more precision than before
    in certain circumstances (repr() and the interactive prompt).

    You can use str() or print to get the old, rounded output:

    >>> print 0.1+0.1
    0.2
    >>>

    Follow the link for more information:

    http://www.python.org/doc/2.2.1/tut/node14.html

  3. transferred this issue fromon Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL