Skip to content

Commit 12878a7

Browse files
committed
Provide more context for what the {f32,f64}::EPSILON values represent.
1 parent 22c25dd commit 12878a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/libcore/num/f32.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ pub const MANTISSA_DIGITS: u32 = 24;
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
pub const DIGITS: u32 = 6;
3535

36-
/// Difference between `1.0` and the next largest representable number.
36+
/// [Machine epsilon] value for `f32`.
37+
///
38+
/// This is the difference between `1.0` and the next largest representable number.
39+
///
40+
/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
3741
#[stable(feature = "rust1", since = "1.0.0")]
3842
pub const EPSILON: f32 = 1.19209290e-07_f32;
3943

src/libcore/num/f64.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ pub const MANTISSA_DIGITS: u32 = 53;
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
pub const DIGITS: u32 = 15;
3535

36-
/// Difference between `1.0` and the next largest representable number.
36+
/// [Machine epsilon] value for `f64`.
37+
///
38+
/// This is the difference between `1.0` and the next largest representable number.
39+
///
40+
/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
3741
#[stable(feature = "rust1", since = "1.0.0")]
3842
pub const EPSILON: f64 = 2.2204460492503131e-16_f64;
3943

0 commit comments

Comments
 (0)