diff options
| author | Pyry Kontio <pyry.kontio@drasa.eu> | 2022-03-31 11:27:23 +0900 |
|---|---|---|
| committer | Pyry Kontio <pyry.kontio@drasa.eu> | 2022-03-31 11:27:23 +0900 |
| commit | 4ee8b64a81b2e518d24f2e8acd2dfeebc686dd5d (patch) | |
| tree | cc995286c463f1e64c1e26d5204ead72786bb54e /library/std/src/primitive_docs.rs | |
| parent | fff5a06f282ae6927fca1fbf8e8ed437e6772b9e (diff) | |
| download | rust-4ee8b64a81b2e518d24f2e8acd2dfeebc686dd5d.tar.gz rust-4ee8b64a81b2e518d24f2e8acd2dfeebc686dd5d.zip | |
Improve wording of "NaN as a special value" top level explanation
Diffstat (limited to 'library/std/src/primitive_docs.rs')
| -rw-r--r-- | library/std/src/primitive_docs.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 188cb8f983b..ab4bb0f2669 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -978,14 +978,15 @@ mod prim_tuple {} /// - [NaN (not a number)](#associatedconstant.NAN): this value results from /// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected /// behavior: -/// - It is unequal to any float, including itself! +/// - It is unequal to any float, including itself! This is the reason `f32` +/// doesn't implement the `Eq` trait. /// - It is also neither smaller nor greater than any float, making it -/// impossible to sort by the default comparison operation. This is the -/// reason `f32` doesn't implement the `Ord` and `Eq` traits. +/// impossible to sort by the default comparison operation, which is the +/// reason `f32` doesn't implement the `Ord` trait. /// - It is also considered *infectious* as almost all calculations where one /// of the operands is NaN will also result in NaN. The explanations on this /// page only explicitly document behavior on NaN operands if this default -/// is *not* observed by the operation. +/// 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, |
