@@ -303,7 +303,7 @@ impl f32 {
303
303
/// ```
304
304
/// let x = 2.0_f32;
305
305
/// let abs_difference = (x.powi(2) - (x * x)).abs();
306
- /// assert!(abs_difference <= f32::EPSILON);
306
+ /// assert!(abs_difference <= 8.0 * f32::EPSILON);
307
307
///
308
308
/// assert_eq!(f32::powi(f32::NAN, 0), 1.0);
309
309
/// ```
@@ -327,7 +327,7 @@ impl f32 {
327
327
/// ```
328
328
/// let x = 2.0_f32;
329
329
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
330
- /// assert!(abs_difference <= f32::EPSILON);
330
+ /// assert!(abs_difference <= 8.0 * f32::EPSILON);
331
331
///
332
332
/// assert_eq!(f32::powf(1.0, f32::NAN), 1.0);
333
333
/// assert_eq!(f32::powf(f32::NAN, 0.0), 1.0);
@@ -387,7 +387,7 @@ impl f32 {
387
387
/// // ln(e) - 1 == 0
388
388
/// let abs_difference = (e.ln() - 1.0).abs();
389
389
///
390
- /// assert!(abs_difference <= f32::EPSILON);
390
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
391
391
/// ```
392
392
#[ rustc_allow_incoherent_impl]
393
393
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -412,7 +412,7 @@ impl f32 {
412
412
/// // 2^2 - 4 == 0
413
413
/// let abs_difference = (f.exp2() - 4.0).abs();
414
414
///
415
- /// assert!(abs_difference <= f32::EPSILON);
415
+ /// assert!(abs_difference <= 8.0 * f32::EPSILON);
416
416
/// ```
417
417
#[ rustc_allow_incoherent_impl]
418
418
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -439,7 +439,7 @@ impl f32 {
439
439
/// // ln(e) - 1 == 0
440
440
/// let abs_difference = (e.ln() - 1.0).abs();
441
441
///
442
- /// assert!(abs_difference <= f32::EPSILON);
442
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
443
443
/// ```
444
444
#[ rustc_allow_incoherent_impl]
445
445
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -468,7 +468,7 @@ impl f32 {
468
468
/// // log5(5) - 1 == 0
469
469
/// let abs_difference = (five.log(5.0) - 1.0).abs();
470
470
///
471
- /// assert!(abs_difference <= f32::EPSILON);
471
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
472
472
/// ```
473
473
#[ rustc_allow_incoherent_impl]
474
474
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -493,7 +493,7 @@ impl f32 {
493
493
/// // log2(2) - 1 == 0
494
494
/// let abs_difference = (two.log2() - 1.0).abs();
495
495
///
496
- /// assert!(abs_difference <= f32::EPSILON);
496
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
497
497
/// ```
498
498
#[ rustc_allow_incoherent_impl]
499
499
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -518,7 +518,7 @@ impl f32 {
518
518
/// // log10(10) - 1 == 0
519
519
/// let abs_difference = (ten.log10() - 1.0).abs();
520
520
///
521
- /// assert!(abs_difference <= f32::EPSILON);
521
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
522
522
/// ```
523
523
#[ rustc_allow_incoherent_impl]
524
524
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -618,7 +618,7 @@ impl f32 {
618
618
/// // sqrt(x^2 + y^2)
619
619
/// let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
620
620
///
621
- /// assert!(abs_difference <= f32::EPSILON);
621
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
622
622
/// ```
623
623
#[ rustc_allow_incoherent_impl]
624
624
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -642,7 +642,7 @@ impl f32 {
642
642
///
643
643
/// let abs_difference = (x.sin() - 1.0).abs();
644
644
///
645
- /// assert!(abs_difference <= f32::EPSILON);
645
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
646
646
/// ```
647
647
#[ rustc_allow_incoherent_impl]
648
648
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -666,7 +666,7 @@ impl f32 {
666
666
///
667
667
/// let abs_difference = (x.cos() - 1.0).abs();
668
668
///
669
- /// assert!(abs_difference <= f32::EPSILON);
669
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
670
670
/// ```
671
671
#[ rustc_allow_incoherent_impl]
672
672
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -750,7 +750,7 @@ impl f32 {
750
750
/// // acos(cos(pi/4))
751
751
/// let abs_difference = (f.cos().acos() - std::f32::consts::FRAC_PI_4).abs();
752
752
///
753
- /// assert!(abs_difference <= f32::EPSILON);
753
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
754
754
/// ```
755
755
#[ doc( alias = "arccos" ) ]
756
756
#[ rustc_allow_incoherent_impl]
@@ -850,8 +850,8 @@ impl f32 {
850
850
/// let abs_difference_0 = (f.0 - x.sin()).abs();
851
851
/// let abs_difference_1 = (f.1 - x.cos()).abs();
852
852
///
853
- /// assert!(abs_difference_0 <= f32::EPSILON);
854
- /// assert!(abs_difference_1 <= f32::EPSILON);
853
+ /// assert!(abs_difference_0 <= 4.0 * f32::EPSILON);
854
+ /// assert!(abs_difference_1 <= 4.0 * f32::EPSILON);
855
855
/// ```
856
856
#[ doc( alias = "sincos" ) ]
857
857
#[ rustc_allow_incoherent_impl]
@@ -1025,7 +1025,7 @@ impl f32 {
1025
1025
///
1026
1026
/// let abs_difference = (f - x).abs();
1027
1027
///
1028
- /// assert!(abs_difference <= f32::EPSILON);
1028
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
1029
1029
/// ```
1030
1030
#[ doc( alias = "arcsinh" ) ]
1031
1031
#[ rustc_allow_incoherent_impl]
@@ -1053,7 +1053,7 @@ impl f32 {
1053
1053
///
1054
1054
/// let abs_difference = (f - x).abs();
1055
1055
///
1056
- /// assert!(abs_difference <= f32::EPSILON);
1056
+ /// assert!(abs_difference <= 4.0 * f32::EPSILON);
1057
1057
/// ```
1058
1058
#[ doc( alias = "arccosh" ) ]
1059
1059
#[ rustc_allow_incoherent_impl]
0 commit comments