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 f32 and f64 primitive documentation #74621

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

LukasKalbertodt
Copy link
Member

I noticed that the docs for the primitive floats were fairly short. I first only wanted to add the IEEE specification information (compare the reference), but then also added some more beginner-friendly docs. Let me know what you think!

Random doc team assign:
r? @rylev

@LukasKalbertodt
Copy link
Member Author

Did I break highfive?

r? @GuillaumeGomez

@LukasKalbertodt LukasKalbertodt added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2020
@GuillaumeGomez
Copy link
Member

Very nice doc improvement, thanks! r=me once CI pass (I'm wary of the links check).

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

(force push fixed footnote typo)

///
/// This type can represent a wide range of decimal numbers, like `3.5`, `27`,
/// `-113.75`, `0.0078125`, `34359738368`, `0`, `-1`. So unlike integer types
/// (like `i32`), floating point types can represent non-integer numbers, too.
Copy link
Member

Choose a reason for hiding this comment

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

unlike followed by (like ...) made me stop reading the sentence for a moment to ensure that I am parsing it correctly, i.e. whether it meant but like .... perhaps it could be replaced with (such as ...) or (e.g. ...) or removed altogether.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, thanks for the feedback! I pushed the "such as" suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

Odd, I'm not seeing that in the merge commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh damn, I think I screwed up a force push. None of the review-fixes are included :(
Will open a follow up PR to fix all of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #75400

src/libstd/primitive_docs.rs Outdated Show resolved Hide resolved
src/libstd/primitive_docs.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Jul 28, 2020

☔ The latest upstream changes (presumably #73265) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz
Copy link

r? @KodrAus

@KodrAus
Copy link
Contributor

KodrAus commented Aug 11, 2020

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Aug 11, 2020

📌 Commit e4d27fa has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 11, 2020
@bors
Copy link
Contributor

bors commented Aug 11, 2020

⌛ Testing commit e4d27fa with merge a9025c5...

@bors
Copy link
Contributor

bors commented Aug 11, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: GuillaumeGomez
Pushing a9025c5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 11, 2020
@bors bors merged commit a9025c5 into rust-lang:master Aug 11, 2020
@LukasKalbertodt LukasKalbertodt deleted the float-docs branch August 11, 2020 09:04
LukasKalbertodt added a commit to LukasKalbertodt/rust that referenced this pull request Aug 11, 2020
All of these were review comments in rust-lang#74621 that I first fixed
in that PR, but later accidentally overwrote by a force push.
/// it is considered infectious as almost all calculations where one of the
/// operands is NaN will also result in NaN.
///
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
///
/// *[See also the `std::f32::consts` module](f32/consts/index.html).*
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we bold just the text?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is consistent with for example

//! *[See also the `i32` primitive type](../../std/primitive.i32.html).*

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Aug 13, 2020
…rAus

Fix minor things in the `f32` primitive docs

All of these were review comments in rust-lang#74621 that I first fixed in that PR, but later accidentally overwrote by a force push.

Thanks @the8472 for noticing.

r? @KodrAus
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 13, 2020
…rAus

Fix minor things in the `f32` primitive docs

All of these were review comments in rust-lang#74621 that I first fixed in that PR, but later accidentally overwrote by a force push.

Thanks @the8472 for noticing.

r? @KodrAus
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants