Skip to content

Commit 5596f88

Browse files
make atanh and erfc doc-tests pass
1 parent 2d5549c commit 5596f88

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

library/std/src/num/f128.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,10 +912,10 @@ impl f128 {
912912
/// # #[cfg(not(miri))]
913913
/// # #[cfg(target_has_reliable_f128_math)] {
914914
///
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();
917917
///
918-
/// let abs_difference = (f - e).abs();
918+
/// let abs_difference = (f - x).abs();
919919
///
920920
/// assert!(abs_difference <= 1e-5);
921921
/// # }

library/std/src/num/f16.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,10 @@ impl f16 {
877877
/// # #[cfg(not(miri))]
878878
/// # #[cfg(target_has_reliable_f16_math)] {
879879
///
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();
882882
///
883-
/// let abs_difference = (f - e).abs();
883+
/// let abs_difference = (f - x).abs();
884884
///
885885
/// assert!(abs_difference <= 0.01);
886886
/// # }

library/std/src/num/f32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,10 @@ impl f32 {
11201120
/// # Examples
11211121
///
11221122
/// ```
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();
11251125
///
1126-
/// let abs_difference = (f - e).abs();
1126+
/// let abs_difference = (f - x).abs();
11271127
///
11281128
/// assert!(abs_difference <= 1e-5);
11291129
/// ```

library/std/src/num/f64.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,10 @@ impl f64 {
11201120
/// # Examples
11211121
///
11221122
/// ```
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();
11251125
///
1126-
/// let abs_difference = (f - e).abs();
1126+
/// let abs_difference = (f - x).abs();
11271127
///
11281128
/// assert!(abs_difference < 1.0e-10);
11291129
/// ```
@@ -1248,7 +1248,7 @@ impl f64 {
12481248
/// let one = x.erf() + x.erfc();
12491249
/// let abs_difference = (one - 1.0).abs();
12501250
///
1251-
/// assert!(abs_difference <= f64::EPSILON);
1251+
/// assert!(abs_difference <= 1e-10);
12521252
/// ```
12531253
#[rustc_allow_incoherent_impl]
12541254
#[must_use = "method returns a new number and does not mutate the original value"]

0 commit comments

Comments
 (0)