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 {
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 /// # }
Original file line number Diff line number Diff 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 /// # }
Original file line number Diff line number Diff 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 /// ```
Original file line number Diff line number Diff 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" ]
You can’t perform that action at this time.
0 commit comments