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

Improve documentation of rounding functions #16056

Closed
wants to merge 1 commit into from

Conversation

Sawyer47
Copy link
Contributor

Important note: I documented current behaviour even though it may not be correct (see issue #15826). round() function for rationals does different rounding than round() from Float trait.

@@ -195,25 +195,25 @@ impl Float for f32 {
(mantissa as u64, exponent, sign)
}

/// Round half-way cases toward `NEG_INFINITY`
/// Round toward minus infinity
Copy link
Contributor

Choose a reason for hiding this comment

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

As long as you're updating these, it would be nice to change them to be more consistent with the prevailing style, i.e.

/// Rounds towards minus infinity.

(note: according to http://aturon.github.io/style/comments.html the summary line is supposed to end in punctuation, which I think is not actually how most of our comments work right now, but better to match the documented style).

@Sawyer47
Copy link
Contributor Author

Thanks for comments. I've changed other comments too, for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants