@@ -443,7 +443,11 @@ fn test_powi() {
443
443
let inf: f32 = f32:: INFINITY ;
444
444
let neg_inf: f32 = f32:: NEG_INFINITY ;
445
445
assert_approx_eq ! ( 1.0f32 . powi( 1 ) , 1.0 ) ;
446
- assert_approx_eq ! ( ( -3.1f32 ) . powi( 2 ) , 9.61 ) ;
446
+ assert_approx_eq ! (
447
+ ( -3.1f32 ) . powi( 2 ) ,
448
+ 9.61 ,
449
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
450
+ ) ;
447
451
assert_approx_eq ! ( 5.9f32 . powi( -2 ) , 0.028727 ) ;
448
452
assert_eq ! ( 8.3f32 . powi( 0 ) , 1.0 ) ;
449
453
assert ! ( nan. powi( 2 ) . is_nan( ) ) ;
@@ -457,9 +461,17 @@ fn test_powf() {
457
461
let inf: f32 = f32:: INFINITY ;
458
462
let neg_inf: f32 = f32:: NEG_INFINITY ;
459
463
assert_eq ! ( 1.0f32 . powf( 1.0 ) , 1.0 ) ;
460
- assert_approx_eq ! ( 3.4f32 . powf( 4.5 ) , 246.408218 ) ;
464
+ assert_approx_eq ! (
465
+ 3.4f32 . powf( 4.5 ) ,
466
+ 246.408218 ,
467
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
468
+ ) ;
461
469
assert_approx_eq ! ( 2.7f32 . powf( -3.2 ) , 0.041652 ) ;
462
- assert_approx_eq ! ( ( -3.1f32 ) . powf( 2.0 ) , 9.61 ) ;
470
+ assert_approx_eq ! (
471
+ ( -3.1f32 ) . powf( 2.0 ) ,
472
+ 9.61 ,
473
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
474
+ ) ;
463
475
assert_approx_eq ! ( 5.9f32 . powf( -2.0 ) , 0.028727 ) ;
464
476
assert_eq ! ( 8.3f32 . powf( 0.0 ) , 1.0 ) ;
465
477
assert ! ( nan. powf( 2.0 ) . is_nan( ) ) ;
@@ -482,7 +494,11 @@ fn test_sqrt_domain() {
482
494
fn test_exp ( ) {
483
495
assert_eq ! ( 1.0 , 0.0f32 . exp( ) ) ;
484
496
assert_approx_eq ! ( 2.718282 , 1.0f32 . exp( ) ) ;
485
- assert_approx_eq ! ( 148.413162 , 5.0f32 . exp( ) ) ;
497
+ assert_approx_eq ! (
498
+ 148.413162 ,
499
+ 5.0f32 . exp( ) ,
500
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
501
+ ) ;
486
502
487
503
let inf: f32 = f32:: INFINITY ;
488
504
let neg_inf: f32 = f32:: NEG_INFINITY ;
@@ -494,7 +510,11 @@ fn test_exp() {
494
510
495
511
#[ test]
496
512
fn test_exp2 ( ) {
497
- assert_approx_eq ! ( 32.0 , 5.0f32 . exp2( ) ) ;
513
+ assert_approx_eq ! (
514
+ 32.0 ,
515
+ 5.0f32 . exp2( ) ,
516
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
517
+ ) ;
498
518
assert_eq ! ( 1.0 , 0.0f32 . exp2( ) ) ;
499
519
500
520
let inf: f32 = f32:: INFINITY ;
@@ -517,7 +537,11 @@ fn test_ln() {
517
537
assert ! ( ( -2.3f32 ) . ln( ) . is_nan( ) ) ;
518
538
assert_eq ! ( ( -0.0f32 ) . ln( ) , neg_inf) ;
519
539
assert_eq ! ( 0.0f32 . ln( ) , neg_inf) ;
520
- assert_approx_eq ! ( 4.0f32 . ln( ) , 1.386294 ) ;
540
+ assert_approx_eq ! (
541
+ 4.0f32 . ln( ) ,
542
+ 1.386294 ,
543
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
544
+ ) ;
521
545
}
522
546
523
547
#[ test]
@@ -543,7 +567,10 @@ fn test_log2() {
543
567
let nan: f32 = f32:: NAN ;
544
568
let inf: f32 = f32:: INFINITY ;
545
569
let neg_inf: f32 = f32:: NEG_INFINITY ;
546
- assert_approx_eq ! ( 10.0f32 . log2( ) , 3.321928 ) ;
570
+ assert_approx_eq ! (
571
+ 10.0f32 . log2( ) ,
572
+ 3.321928 /* Miri float-non-det: Make tests pass for now */
573
+ ) ;
547
574
assert_approx_eq ! ( 2.3f32 . log2( ) , 1.201634 ) ;
548
575
assert_approx_eq ! ( 1.0f32 . exp( ) . log2( ) , 1.442695 ) ;
549
576
assert ! ( nan. log2( ) . is_nan( ) ) ;
@@ -639,7 +666,11 @@ fn test_acosh() {
639
666
assert_approx_eq ! ( 3.0f32 . acosh( ) , 1.76274717403908605046521864995958461f32 ) ;
640
667
641
668
// test for low accuracy from issue 104548
642
- assert_approx_eq ! ( 60.0f32 , 60.0f32 . cosh( ) . acosh( ) ) ;
669
+ assert_approx_eq ! (
670
+ 60.0f32 ,
671
+ 60.0f32 . cosh( ) . acosh( ) ,
672
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
673
+ ) ;
643
674
}
644
675
645
676
#[ test]
@@ -718,7 +749,11 @@ fn test_real_consts() {
718
749
let ln_10: f32 = consts:: LN_10 ;
719
750
720
751
assert_approx_eq ! ( frac_pi_2, pi / 2f32 ) ;
721
- assert_approx_eq ! ( frac_pi_3, pi / 3f32 ) ;
752
+ assert_approx_eq ! (
753
+ frac_pi_3,
754
+ pi / 3f32 ,
755
+ 1e-4 /* Miri float-non-det: Make tests pass for now */
756
+ ) ;
722
757
assert_approx_eq ! ( frac_pi_4, pi / 4f32 ) ;
723
758
assert_approx_eq ! ( frac_pi_6, pi / 6f32 ) ;
724
759
assert_approx_eq ! ( frac_pi_8, pi / 8f32 ) ;
0 commit comments