Document rounding for floating-point primitive operations and string parsing#96129
Document rounding for floating-point primitive operations and string parsing#96129bors merged 2 commits intorust-lang:masterfrom
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 ↩