@@ -443,7 +443,11 @@ fn test_powi() {
443443 let inf: f32 = f32:: INFINITY ;
444444 let neg_inf: f32 = f32:: NEG_INFINITY ;
445445 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+ ) ;
447451 assert_approx_eq ! ( 5.9f32 . powi( -2 ) , 0.028727 ) ;
448452 assert_eq ! ( 8.3f32 . powi( 0 ) , 1.0 ) ;
449453 assert ! ( nan. powi( 2 ) . is_nan( ) ) ;
@@ -457,9 +461,17 @@ fn test_powf() {
457461 let inf: f32 = f32:: INFINITY ;
458462 let neg_inf: f32 = f32:: NEG_INFINITY ;
459463 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+ ) ;
461469 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+ ) ;
463475 assert_approx_eq ! ( 5.9f32 . powf( -2.0 ) , 0.028727 ) ;
464476 assert_eq ! ( 8.3f32 . powf( 0.0 ) , 1.0 ) ;
465477 assert ! ( nan. powf( 2.0 ) . is_nan( ) ) ;
@@ -482,7 +494,11 @@ fn test_sqrt_domain() {
482494fn test_exp ( ) {
483495 assert_eq ! ( 1.0 , 0.0f32 . exp( ) ) ;
484496 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+ ) ;
486502
487503 let inf: f32 = f32:: INFINITY ;
488504 let neg_inf: f32 = f32:: NEG_INFINITY ;
@@ -494,7 +510,11 @@ fn test_exp() {
494510
495511#[ test]
496512fn 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+ ) ;
498518 assert_eq ! ( 1.0 , 0.0f32 . exp2( ) ) ;
499519
500520 let inf: f32 = f32:: INFINITY ;
@@ -517,7 +537,11 @@ fn test_ln() {
517537 assert ! ( ( -2.3f32 ) . ln( ) . is_nan( ) ) ;
518538 assert_eq ! ( ( -0.0f32 ) . ln( ) , neg_inf) ;
519539 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+ ) ;
521545}
522546
523547#[ test]
@@ -543,7 +567,10 @@ fn test_log2() {
543567 let nan: f32 = f32:: NAN ;
544568 let inf: f32 = f32:: INFINITY ;
545569 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+ ) ;
547574 assert_approx_eq ! ( 2.3f32 . log2( ) , 1.201634 ) ;
548575 assert_approx_eq ! ( 1.0f32 . exp( ) . log2( ) , 1.442695 ) ;
549576 assert ! ( nan. log2( ) . is_nan( ) ) ;
@@ -639,7 +666,11 @@ fn test_acosh() {
639666 assert_approx_eq ! ( 3.0f32 . acosh( ) , 1.76274717403908605046521864995958461f32 ) ;
640667
641668 // 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+ ) ;
643674}
644675
645676#[ test]
@@ -718,7 +749,11 @@ fn test_real_consts() {
718749 let ln_10: f32 = consts:: LN_10 ;
719750
720751 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+ ) ;
722757 assert_approx_eq ! ( frac_pi_4, pi / 4f32 ) ;
723758 assert_approx_eq ! ( frac_pi_6, pi / 6f32 ) ;
724759 assert_approx_eq ! ( frac_pi_8, pi / 8f32 ) ;
0 commit comments