File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -479,7 +479,7 @@ impl f32 {
479
479
/// // log5(5) - 1 == 0
480
480
/// let abs_difference = (five.log(5.0) - 1.0).abs();
481
481
///
482
- /// assert!(abs_difference <= 1e-6 );
482
+ /// assert!(abs_difference <= 1e-7 );
483
483
/// ```
484
484
///
485
485
/// Non-positive values:
@@ -1125,7 +1125,7 @@ impl f32 {
1125
1125
///
1126
1126
/// let abs_difference = (f - e).abs();
1127
1127
///
1128
- /// assert!(abs_difference <= 1e-4 );
1128
+ /// assert!(abs_difference <= 1e-5 );
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 <= 1e-4 );
1156
+ /// assert!(abs_difference <= 1e-5 );
1157
1157
/// ```
1158
1158
#[ rustc_allow_incoherent_impl]
1159
1159
#[ must_use = "method returns a new number and does not mutate the original value" ]
Original file line number Diff line number Diff line change @@ -1248,7 +1248,7 @@ impl f64 {
1248
1248
/// let one = x.erf() + x.erfc();
1249
1249
/// let abs_difference = (one - 1.0).abs();
1250
1250
///
1251
- /// assert!(abs_difference <= 1e-10 );
1251
+ /// assert!(abs_difference <= f64::EPSILON );
1252
1252
/// ```
1253
1253
#[ rustc_allow_incoherent_impl]
1254
1254
#[ must_use = "method returns a new number and does not mutate the original value" ]
Original file line number Diff line number Diff line change @@ -196,10 +196,10 @@ fn test_gamma() {
196
196
assert_approx_eq ! ( 1.0f32 . gamma( ) , 1.0f32 ) ;
197
197
assert_approx_eq ! ( 2.0f32 . gamma( ) , 1.0f32 ) ;
198
198
assert_approx_eq ! ( 3.0f32 . gamma( ) , 2.0f32 ) ;
199
- assert_approx_eq ! ( 4.0f32 . gamma( ) , 6.0f32 , APPROX_DELTA ) ;
199
+ assert_approx_eq ! ( 4.0f32 . gamma( ) , 6.0f32 ) ;
200
200
assert_approx_eq ! ( 5.0f32 . gamma( ) , 24.0f32 , APPROX_DELTA ) ;
201
201
assert_approx_eq ! ( 0.5f32 . gamma( ) , consts:: PI . sqrt( ) ) ;
202
- assert_approx_eq ! ( ( -0.5f32 ) . gamma( ) , -2.0 * consts:: PI . sqrt( ) , APPROX_DELTA ) ;
202
+ assert_approx_eq ! ( ( -0.5f32 ) . gamma( ) , -2.0 * consts:: PI . sqrt( ) ) ;
203
203
assert_eq ! ( 0.0f32 . gamma( ) , f32 :: INFINITY ) ;
204
204
assert_eq ! ( ( -0.0f32 ) . gamma( ) , f32 :: NEG_INFINITY ) ;
205
205
assert ! ( ( -1.0f32 ) . gamma( ) . is_nan( ) ) ;
You can’t perform that action at this time.
0 commit comments