Skip to content

Improve floating point documentation #95483

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

Merged
merged 8 commits into from
May 9, 2022
Prev Previous commit
Next Next commit
Further refine the disclaimer about NaN bit patterns.
  • Loading branch information
golddranks committed Mar 31, 2022
commit 21f1037c5846f1c796699dcbc2cdf38c663210e1
5 changes: 3 additions & 2 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,9 @@ mod prim_tuple {}
/// is deviated from.
/// - Lastly, there are multiple bit patterns that are considered NaN.
/// Rust does not currently guarantee that the bit patterns of NaN are
/// preserved over arithmetic operations,
/// so there may be some surprising results upon inspecting the bit patterns,
/// preserved over arithmetic operations, and they are not guaranteed to be
/// portable or even fully deterministic! This means that there may be some
/// surprising results upon inspecting the bit patterns,
/// as the same calculations might produce NaNs with different bit patterns.
///
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
Expand Down