diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-08-13 11:05:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-13 11:05:37 +0900 |
| commit | 66157e27e2b1fa49aa745fbca2ed92e035256e88 (patch) | |
| tree | 597f6ef5f0b99370b3e1b9e91c12412a33f65354 | |
| parent | d90a4b8ae9c6283bfae537f65e0cee41a69ed5f7 (diff) | |
| parent | 709d1056b890de640c3d8dabd70562950df98dcf (diff) | |
| download | rust-66157e27e2b1fa49aa745fbca2ed92e035256e88.tar.gz rust-66157e27e2b1fa49aa745fbca2ed92e035256e88.zip | |
Rollup merge of #75400 - LukasKalbertodt:fix-f32-docs, r=KodrAus
Fix minor things in the `f32` primitive docs All of these were review comments in #74621 that I first fixed in that PR, but later accidentally overwrote by a force push. Thanks @the8472 for noticing. r? @KodrAus
| -rw-r--r-- | library/std/src/primitive_docs.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index f9c96b7c3d4..0d2aca6bbc3 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -768,7 +768,8 @@ mod prim_tuple {} /// /// 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. +/// (such as `i32`), floating point types can represent non-integer numbers, +/// too. /// /// However, being able to represent this wide range of numbers comes at the /// cost of precision: floats can only represent some of the real numbers and @@ -779,15 +780,12 @@ mod prim_tuple {} /// often discard insignificant digits: `println!("{}", 1.0f32 / 5.0f32)` will /// print `0.2`. /// -/// The precision is better for numbers near 0 and worse for large numbers. For -/// example, above 2<sup>24</sup>, not even all integers are representable. -/// /// Additionally, `f32` can represent a couple of special values: /// /// - `-0`: this is just due to how floats are encoded. It is semantically /// equivalent to `0` and `-0.0 == 0.0` results in `true`. /// - [∞](#associatedconstant.INFINITY) and -/// [-∞](#associatedconstant.NEG_INFINITY): these result from calculations +/// [−∞](#associatedconstant.NEG_INFINITY): these result from calculations /// like `1.0 / 0.0`. /// - [NaN (not a number)](#associatedconstant.NAN): this value results from /// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected |
