-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Document rounding for floating-point primitive operations and string parsing #96129
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
Conversation
State that the four primitive operations honour IEEE 754 roundTiesToEven. Documenting under "Primitive Type f32"; f64 refers to that.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) soon. Please see the contribution instructions for more information. |
r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs |
@bors r+ rollup |
📌 Commit 16c81fa has been approved by |
Rollup of 4 pull requests Successful merges: - rust-lang#96129 (Document rounding for floating-point primitive operations and string parsing) - rust-lang#97286 (Add new eslint rule to prevent whitespace before function call paren) - rust-lang#97292 (Lifetime variance fixes for rustc) - rust-lang#97309 (Add some regression tests for rust-lang#90400) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The docs for floating point don't have much to say at present about either the precision of their results or rounding behaviour.
As I understand it12, Rust doesn't support operating with non-default rounding directions, so we need only describe roundTiesToEven.
This PR makes a start by documenting that for primitive operations and
from_str()
.Footnotes
https://github.com/rust-lang/rust/issues/41753#issuecomment-299322887 ↩
https://github.com/llvm/llvm-project/issues/8472#issuecomment-980888781 ↩