about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-29 22:57:41 +0100
committerGitHub <noreply@github.com>2019-11-29 22:57:41 +0100
commit395937823c65d0dc6469e5df864b1e1b0f5a2b3f (patch)
tree331df5488b167bd8b5cff854b12936b6a827a535 /src/libcore
parent5c9081181480e1df9fc41bfb488b4936d1f1e4d8 (diff)
parent85a468b8cfc8957c337b426b618dd84984967c3b (diff)
downloadrust-395937823c65d0dc6469e5df864b1e1b0f5a2b3f.tar.gz
rust-395937823c65d0dc6469e5df864b1e1b0f5a2b3f.zip
Rollup merge of #66837 - ohadravid:epsilon-doc, r=dtolnay
Clarify `{f32,f64}::EPSILON` docs

The doc for `EPSILON` says:
>  This is the difference between `1.0` and the next **largest** representable number.

Which is a bit unclear.

[Wikipedia](https://en.wikipedia.org/wiki/Machine_epsilon) says
> Machine epsilon is defined as the difference between 1 and the next **larger** floating point number

So this PR update the docs to match the Wikipedia version.

The original PR also has this in a [comment](https://github.com/rust-lang/rust/pull/50919#discussion_r192600209).
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/num/f32.rs2
-rw-r--r--src/libcore/num/f64.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs
index 38b3fab6d75..913c0f96d11 100644
--- a/src/libcore/num/f32.rs
+++ b/src/libcore/num/f32.rs
@@ -26,7 +26,7 @@ pub const DIGITS: u32 = 6;
 
 /// [Machine epsilon] value for `f32`.
 ///
-/// This is the difference between `1.0` and the next largest representable number.
+/// This is the difference between `1.0` and the next larger representable number.
 ///
 /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
 #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs
index f093bae9590..6ca830b1f38 100644
--- a/src/libcore/num/f64.rs
+++ b/src/libcore/num/f64.rs
@@ -26,7 +26,7 @@ pub const DIGITS: u32 = 15;
 
 /// [Machine epsilon] value for `f64`.
 ///
-/// This is the difference between `1.0` and the next largest representable number.
+/// This is the difference between `1.0` and the next larger representable number.
 ///
 /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
 #[stable(feature = "rust1", since = "1.0.0")]