Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

round docstring is inaccurate #47441

Closed
mdickinson opened this issue Jun 24, 2008 · 2 comments
Closed

round docstring is inaccurate #47441

mdickinson opened this issue Jun 24, 2008 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@mdickinson
Copy link
Member

BPO 3191
Nosy @birkenfeld, @mdickinson

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 = 'https://github.com/mdickinson'
closed_at = <Date 2008-07-01.20:40:12.149>
created_at = <Date 2008-06-24.15:03:36.574>
labels = ['docs']
title = 'round docstring is inaccurate'
updated_at = <Date 2008-07-01.20:40:12.144>
user = 'https://github.com/mdickinson'

bugs.python.org fields:

activity = <Date 2008-07-01.20:40:12.144>
actor = 'georg.brandl'
assignee = 'mark.dickinson'
closed = True
closed_date = <Date 2008-07-01.20:40:12.149>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2008-06-24.15:03:36.574>
creator = 'mark.dickinson'
dependencies = []
files = []
hgrepos = []
issue_num = 3191
keywords = []
message_count = 2.0
messages = ['68690', '69073']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'mark.dickinson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue3191'
versions = ['Python 3.0']

@mdickinson
Copy link
Member Author

In Python 3.0, help(round) gives the following:

round(...)
    round(number[, ndigits]) -> floating point number
    
    Round a number to a given precision in decimal digits (default 0 
digits).
    This returns an int when called with one argument, otherwise a 
float.
    Precision may be negative.

But in Python 3.x, round(x, n) doesn't always return a float; for
example, if x is a Decimal or Fraction then round(x, 2) is again a
Decimal or Fraction (respectively).

@mdickinson mdickinson added the docs Documentation in the Doc dir label Jun 24, 2008
@mdickinson mdickinson assigned mdickinson and unassigned birkenfeld Jun 30, 2008
@birkenfeld
Copy link
Member

Fixed in r64634.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants