File tree Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -912,10 +912,10 @@ impl f128 {
912
912
/// # #[cfg(not(miri))]
913
913
/// # #[cfg(target_has_reliable_f128_math)] {
914
914
///
915
- /// let e = std::f128::consts::E ;
916
- /// let f = e .tanh().atanh();
915
+ /// let x = std::f128::consts::FRAC_PI_6 ;
916
+ /// let f = x .tanh().atanh();
917
917
///
918
- /// let abs_difference = (f - e ).abs();
918
+ /// let abs_difference = (f - x ).abs();
919
919
///
920
920
/// assert!(abs_difference <= 1e-5);
921
921
/// # }
Original file line number Diff line number Diff line change @@ -877,10 +877,10 @@ impl f16 {
877
877
/// # #[cfg(not(miri))]
878
878
/// # #[cfg(target_has_reliable_f16_math)] {
879
879
///
880
- /// let e = std::f16::consts::E ;
881
- /// let f = e .tanh().atanh();
880
+ /// let x = std::f16::consts::FRAC_PI_6 ;
881
+ /// let f = x .tanh().atanh();
882
882
///
883
- /// let abs_difference = (f - e ).abs();
883
+ /// let abs_difference = (f - x ).abs();
884
884
///
885
885
/// assert!(abs_difference <= 0.01);
886
886
/// # }
Original file line number Diff line number Diff line change @@ -1120,10 +1120,10 @@ impl f32 {
1120
1120
/// # Examples
1121
1121
///
1122
1122
/// ```
1123
- /// let e = std::f32::consts::E ;
1124
- /// let f = e .tanh().atanh();
1123
+ /// let x = std::f32::consts::FRAC_PI_6 ;
1124
+ /// let f = x .tanh().atanh();
1125
1125
///
1126
- /// let abs_difference = (f - e ).abs();
1126
+ /// let abs_difference = (f - x ).abs();
1127
1127
///
1128
1128
/// assert!(abs_difference <= 1e-5);
1129
1129
/// ```
Original file line number Diff line number Diff line change @@ -1120,10 +1120,10 @@ impl f64 {
1120
1120
/// # Examples
1121
1121
///
1122
1122
/// ```
1123
- /// let e = std::f64::consts::E ;
1124
- /// let f = e .tanh().atanh();
1123
+ /// let x = std::f64::consts::FRAC_PI_6 ;
1124
+ /// let f = x .tanh().atanh();
1125
1125
///
1126
- /// let abs_difference = (f - e ).abs();
1126
+ /// let abs_difference = (f - x ).abs();
1127
1127
///
1128
1128
/// assert!(abs_difference < 1.0e-10);
1129
1129
/// ```
@@ -1248,7 +1248,7 @@ impl f64 {
1248
1248
/// let one = x.erf() + x.erfc();
1249
1249
/// let abs_difference = (one - 1.0).abs();
1250
1250
///
1251
- /// assert!(abs_difference <= f64::EPSILON );
1251
+ /// assert!(abs_difference <= 1e-10 );
1252
1252
/// ```
1253
1253
#[ rustc_allow_incoherent_impl]
1254
1254
#[ must_use = "method returns a new number and does not mutate the original value" ]
You can’t perform that action at this time.
0 commit comments