diff options
| author | Corey Farwell <coreyf@rwell.org> | 2018-05-20 12:39:13 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2018-05-28 09:28:40 -0400 |
| commit | 12878a78a7528dbe5888fe70fd5a0861c820c86a (patch) | |
| tree | 8d8f602b9ac811245777c4c876b66563e4b65646 | |
| parent | 22c25dd73704701a3997d4f8503cbb2bc395a252 (diff) | |
| download | rust-12878a78a7528dbe5888fe70fd5a0861c820c86a.tar.gz rust-12878a78a7528dbe5888fe70fd5a0861c820c86a.zip | |
Provide more context for what the {f32,f64}::EPSILON values represent.
| -rw-r--r-- | src/libcore/num/f32.rs | 6 | ||||
| -rw-r--r-- | src/libcore/num/f64.rs | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index 718dd42a615..65332d4b97a 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -33,7 +33,11 @@ pub const MANTISSA_DIGITS: u32 = 24; #[stable(feature = "rust1", since = "1.0.0")] pub const DIGITS: u32 = 6; -/// Difference between `1.0` and the next largest representable number. +/// [Machine epsilon] value for `f32`. +/// +/// This is the difference between `1.0` and the next largest representable number. +/// +/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon #[stable(feature = "rust1", since = "1.0.0")] pub const EPSILON: f32 = 1.19209290e-07_f32; diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index f128c55c78a..c9a643e7b33 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -33,7 +33,11 @@ pub const MANTISSA_DIGITS: u32 = 53; #[stable(feature = "rust1", since = "1.0.0")] pub const DIGITS: u32 = 15; -/// Difference between `1.0` and the next largest representable number. +/// [Machine epsilon] value for `f64`. +/// +/// This is the difference between `1.0` and the next largest representable number. +/// +/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon #[stable(feature = "rust1", since = "1.0.0")] pub const EPSILON: f64 = 2.2204460492503131e-16_f64; |
