Skip to content

Commit 4462568

Browse files
address review and fix test failures
1 parent d132189 commit 4462568

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/std/src/num/f32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,9 @@ impl f32 {
752752
/// let f = std::f32::consts::FRAC_PI_4;
753753
///
754754
/// // asin(sin(pi/2))
755-
/// let abs_difference = (f.sin().asin() - std::f32::consts::FRAC_PI_2).abs();
755+
/// let abs_difference = (f.sin().asin() - f).abs();
756756
///
757-
/// assert!(abs_difference <= 1e-1);
757+
/// assert!(abs_difference <= 1e-6);
758758
/// ```
759759
#[doc(alias = "arcsin")]
760760
#[rustc_allow_incoherent_impl]
@@ -1095,7 +1095,7 @@ impl f32 {
10951095
///
10961096
/// let abs_difference = (f - x).abs();
10971097
///
1098-
/// assert!(abs_difference <= 1e-6);
1098+
/// assert!(abs_difference <= 1e-5);
10991099
/// ```
11001100
#[doc(alias = "arccosh")]
11011101
#[rustc_allow_incoherent_impl]

library/std/src/num/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,9 @@ impl f64 {
752752
/// let f = std::f64::consts::FRAC_PI_4;
753753
///
754754
/// // asin(sin(pi/2))
755-
/// let abs_difference = (f.sin().asin() - std::f64::consts::FRAC_PI_2).abs();
755+
/// let abs_difference = (f.sin().asin() - f).abs();
756756
///
757-
/// assert!(abs_difference < 1e-7);
757+
/// assert!(abs_difference < 1e-14);
758758
/// ```
759759
#[doc(alias = "arcsin")]
760760
#[rustc_allow_incoherent_impl]

0 commit comments

Comments
 (0)