bpo-29677: DOC: clarify documentation for round by gerritholl · Pull Request #357 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits2 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

gerritholl

Clarified that round can take a negative value for ndigits.

@gerritholl

Clarified that round can take a negative value for ndigits.

@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow these steps to help rectify the issue:

  1. If you don't have an account on b.p.o, please create one
  2. Make sure your GitHub username is listed in "Your Details" at b.p.o
  3. If you have not already done so, please sign the PSF contributor agreement. The "bugs.python.org username " requested by the form is the "Login name" field under "Your Details".
  4. If you just signed the CLA, please wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  5. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

@gerritholl

remove trailing whitespace in previous commit

@mdickinson mdickinson changed the titleDOC: clarify documentation for round bpo-29677: DOC: clarify documentation for round

Feb 28, 2017

vstinner

@@ -1262,7 +1262,8 @@ are always available. They are listed here in alphabetical order.
closest multiple of 10 to the power minus *ndigits*; if two multiples are

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we are modifying the doc, I dislike the start: "Return the floating point value number": number can be an integer. round(123, -2) doesn't use floating point numbers. Maybe rephrase to following text?

Return number rounded to (...). number can be an integer or a floating point number.

Or just remove "floating pointer number"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Haypo: agree:

Return number rounded to ndigits digits after the decimal point.

seems good to me.

About the negation, placement is good (too soon would have diluted the definition). About its wording, I'd prefer telling what it does instead of just stating it's possible, something like:

Negative ndigits permit rouding before the decimal point.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we can accept this PR? If you would still like to see improvement with the first sentence, perhaps we can keep the issue open, so another person can work on it. Otherwise, @gerritholl's change in this PR seems good.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a few changes trying to clarify the wording for round. I hope I didn't overstep any bounds. I researched other, similar functions and looked at the help(). In the first line I wanted to say 'Return the real number x', but float() didn't specify real number, even though they both don't work on Complex.

Anyway, this is my first pull, so I hope I did OK. :-)

@vstinner

Mariatta

Mariatta pushed a commit to Mariatta/cpython that referenced this pull request

Mar 27, 2017

@gerritholl @Mariatta

Clarified that round can take a negative value for ndigits.

remove trailing whitespace in previous commit

(cherry picked from commit 6003db7)

Mariatta pushed a commit to Mariatta/cpython that referenced this pull request

Mar 27, 2017

@gerritholl @Mariatta

Clarified that round can take a negative value for ndigits.

remove trailing whitespace in previous commit

(cherry picked from commit 6003db7)

Mariatta added a commit that referenced this pull request

Mar 28, 2017

@Mariatta

(cherry picked from commit 6003db7)

@Mariatta

Thanks @gerritholl for your first contribution to CPython 🎉
Thanks @Haypo for merging this. I cherry-picked this into 3.5 and 3.6, but getting conflict in 2.7, so I won't bother with that branch 🤷‍♀️

Mariatta added a commit that referenced this pull request

Mar 28, 2017

@Mariatta

(cherry picked from commit 6003db7)

Labels

docs

Documentation in the Doc dir