@@ -582,8 +582,8 @@ impl f32 {
582
582
/// let abs_difference_x = (x.abs_sub(1.0) - 2.0).abs();
583
583
/// let abs_difference_y = (y.abs_sub(1.0) - 0.0).abs();
584
584
///
585
- /// assert!(abs_difference_x <= f32::EPSILON );
586
- /// assert!(abs_difference_y <= f32::EPSILON );
585
+ /// assert!(abs_difference_x <= 1e-6 );
586
+ /// assert!(abs_difference_y <= 1e-6 );
587
587
/// ```
588
588
#[ rustc_allow_incoherent_impl]
589
589
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -621,7 +621,7 @@ impl f32 {
621
621
/// // x^(1/3) - 2 == 0
622
622
/// let abs_difference = (x.cbrt() - 2.0).abs();
623
623
///
624
- /// assert!(abs_difference <= f32::EPSILON );
624
+ /// assert!(abs_difference <= 1e-6 );
625
625
/// ```
626
626
#[ rustc_allow_incoherent_impl]
627
627
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -652,7 +652,7 @@ impl f32 {
652
652
/// // sqrt(x^2 + y^2)
653
653
/// let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
654
654
///
655
- /// assert!(abs_difference <= 1e-6 );
655
+ /// assert!(abs_difference <= 1e-5 );
656
656
/// ```
657
657
#[ rustc_allow_incoherent_impl]
658
658
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -725,7 +725,7 @@ impl f32 {
725
725
/// let x = std::f32::consts::FRAC_PI_4;
726
726
/// let abs_difference = (x.tan() - 1.0).abs();
727
727
///
728
- /// assert!(abs_difference <= f32::EPSILON );
728
+ /// assert!(abs_difference <= 1e-6 );
729
729
/// ```
730
730
#[ rustc_allow_incoherent_impl]
731
731
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -813,7 +813,7 @@ impl f32 {
813
813
/// // atan(tan(1))
814
814
/// let abs_difference = (f.tan().atan() - 1.0).abs();
815
815
///
816
- /// assert!(abs_difference <= f32::EPSILON );
816
+ /// assert!(abs_difference <= 1e-6 );
817
817
/// ```
818
818
#[ doc( alias = "arctan" ) ]
819
819
#[ rustc_allow_incoherent_impl]
@@ -854,8 +854,8 @@ impl f32 {
854
854
/// let abs_difference_1 = (y1.atan2(x1) - (-std::f32::consts::FRAC_PI_4)).abs();
855
855
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * std::f32::consts::FRAC_PI_4)).abs();
856
856
///
857
- /// assert!(abs_difference_1 <= f32::EPSILON );
858
- /// assert!(abs_difference_2 <= f32::EPSILON );
857
+ /// assert!(abs_difference_1 <= 1e-5 );
858
+ /// assert!(abs_difference_2 <= 1e-5 );
859
859
/// ```
860
860
#[ rustc_allow_incoherent_impl]
861
861
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -982,7 +982,7 @@ impl f32 {
982
982
/// let g = ((e * e) - 1.0) / (2.0 * e);
983
983
/// let abs_difference = (f - g).abs();
984
984
///
985
- /// assert!(abs_difference <= f32::EPSILON );
985
+ /// assert!(abs_difference <= 1e-6 );
986
986
/// ```
987
987
#[ rustc_allow_incoherent_impl]
988
988
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1012,7 +1012,7 @@ impl f32 {
1012
1012
/// let abs_difference = (f - g).abs();
1013
1013
///
1014
1014
/// // Same result
1015
- /// assert!(abs_difference <= f32::EPSILON );
1015
+ /// assert!(abs_difference <= 1e-6 );
1016
1016
/// ```
1017
1017
#[ rustc_allow_incoherent_impl]
1018
1018
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1042,7 +1042,7 @@ impl f32 {
1042
1042
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
1043
1043
/// let abs_difference = (f - g).abs();
1044
1044
///
1045
- /// assert!(abs_difference <= f32::EPSILON );
1045
+ /// assert!(abs_difference <= 1e-6 );
1046
1046
/// ```
1047
1047
#[ rustc_allow_incoherent_impl]
1048
1048
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1095,7 +1095,7 @@ impl f32 {
1095
1095
///
1096
1096
/// let abs_difference = (f - x).abs();
1097
1097
///
1098
- /// assert!(abs_difference <= 1e-6 );
1098
+ /// assert!(abs_difference <= 1e-5 );
1099
1099
/// ```
1100
1100
#[ doc( alias = "arccosh" ) ]
1101
1101
#[ rustc_allow_incoherent_impl]
@@ -1125,7 +1125,7 @@ impl f32 {
1125
1125
///
1126
1126
/// let abs_difference = (f - e).abs();
1127
1127
///
1128
- /// assert!(abs_difference <= 1e-5 );
1128
+ /// assert!(abs_difference <= 1e-4 );
1129
1129
/// ```
1130
1130
#[ doc( alias = "arctanh" ) ]
1131
1131
#[ rustc_allow_incoherent_impl]
@@ -1153,7 +1153,7 @@ impl f32 {
1153
1153
///
1154
1154
/// let abs_difference = (x.gamma() - 24.0).abs();
1155
1155
///
1156
- /// assert!(abs_difference <= f32::EPSILON );
1156
+ /// assert!(abs_difference <= 1e-4 );
1157
1157
/// ```
1158
1158
#[ rustc_allow_incoherent_impl]
1159
1159
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1248,7 +1248,7 @@ impl f32 {
1248
1248
/// let one = x.erf() + x.erfc();
1249
1249
/// let abs_difference = (one - 1.0).abs();
1250
1250
///
1251
- /// assert!(abs_difference <= f32::EPSILON );
1251
+ /// assert!(abs_difference <= 1e-6 );
1252
1252
/// ```
1253
1253
#[ rustc_allow_incoherent_impl]
1254
1254
#[ must_use = "method returns a new number and does not mutate the original value" ]
0 commit comments