@@ -24,8 +24,6 @@ var resolve = require( 'path' ).resolve;
2424var tape = require ( 'tape' ) ;
2525var isnanf = require ( './../../../../base/assert/is-nanf' ) ;
2626var float64ToFloat32 = require ( '@stdlib/number/float64/base/to-float32' ) ;
27- var absf = require ( './../../../../base/special/absf' ) ;
28- var EPS = require ( '@stdlib/constants/float32/eps' ) ;
2927var tryRequire = require ( '@stdlib/utils/try-require' ) ;
3028
3129
@@ -58,8 +56,6 @@ tape( 'main export is a function', opts, function test( t ) {
5856
5957tape ( 'the function evaluates the modulus function (subnormal results)' , opts , function test ( t ) {
6058 var expected ;
61- var delta ;
62- var tol ;
6359 var v ;
6460 var x ;
6561 var y ;
@@ -72,17 +68,13 @@ tape( 'the function evaluates the modulus function (subnormal results)', opts, f
7268 for ( i = 0 ; i < x . length ; i ++ ) {
7369 e = float64ToFloat32 ( expected [ i ] ) ;
7470 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
75- delta = absf ( v - e ) ;
76- tol = EPS * absf ( e ) ;
77- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
71+ t . strictEqual ( v , e , 'returns expected value' ) ;
7872 }
7973 t . end ( ) ;
8074} ) ;
8175
8276tape ( 'the function evaluates the modulus function (small `x`, large `y`)' , opts , function test ( t ) {
8377 var expected ;
84- var delta ;
85- var tol ;
8678 var v ;
8779 var x ;
8880 var y ;
@@ -95,17 +87,13 @@ tape( 'the function evaluates the modulus function (small `x`, large `y`)', opts
9587 for ( i = 0 ; i < x . length ; i ++ ) {
9688 e = float64ToFloat32 ( expected [ i ] ) ;
9789 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
98- delta = absf ( v - e ) ;
99- tol = EPS * absf ( e ) ;
100- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
90+ t . strictEqual ( v , e , 'returns expected value' ) ;
10191 }
10292 t . end ( ) ;
10393} ) ;
10494
10595tape ( 'the function evaluates the modulus function (large `x`, small `y`)' , opts , function test ( t ) {
10696 var expected ;
107- var delta ;
108- var tol ;
10997 var v ;
11098 var x ;
11199 var y ;
@@ -118,17 +106,13 @@ tape( 'the function evaluates the modulus function (large `x`, small `y`)', opts
118106 for ( i = 0 ; i < x . length ; i ++ ) {
119107 e = float64ToFloat32 ( expected [ i ] ) ;
120108 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
121- delta = absf ( v - e ) ;
122- tol = EPS * absf ( e ) ;
123- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
109+ t . strictEqual ( v , e , 'returns expected value' ) ;
124110 }
125111 t . end ( ) ;
126112} ) ;
127113
128114tape ( 'the function evaluates the modulus function (small `x`, small `y`)' , opts , function test ( t ) {
129115 var expected ;
130- var delta ;
131- var tol ;
132116 var v ;
133117 var x ;
134118 var y ;
@@ -141,17 +125,13 @@ tape( 'the function evaluates the modulus function (small `x`, small `y`)', opts
141125 for ( i = 0 ; i < x . length ; i ++ ) {
142126 e = float64ToFloat32 ( expected [ i ] ) ;
143127 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
144- delta = absf ( v - e ) ;
145- tol = EPS * absf ( e ) ;
146- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
128+ t . strictEqual ( v , e , 'returns expected value' ) ;
147129 }
148130 t . end ( ) ;
149131} ) ;
150132
151133tape ( 'the function evaluates the modulus function (positive `x`, negative `y`)' , opts , function test ( t ) {
152134 var expected ;
153- var delta ;
154- var tol ;
155135 var v ;
156136 var x ;
157137 var y ;
@@ -164,17 +144,13 @@ tape( 'the function evaluates the modulus function (positive `x`, negative `y`)'
164144 for ( i = 0 ; i < x . length ; i ++ ) {
165145 e = float64ToFloat32 ( expected [ i ] ) ;
166146 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
167- delta = absf ( v - e ) ;
168- tol = EPS * absf ( e ) ;
169- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
147+ t . strictEqual ( v , e , 'returns expected value' ) ;
170148 }
171149 t . end ( ) ;
172150} ) ;
173151
174152tape ( 'the function evaluates the modulus function (negative `x`, positive `y`)' , opts , function test ( t ) {
175153 var expected ;
176- var delta ;
177- var tol ;
178154 var v ;
179155 var x ;
180156 var y ;
@@ -187,17 +163,13 @@ tape( 'the function evaluates the modulus function (negative `x`, positive `y`)'
187163 for ( i = 0 ; i < x . length ; i ++ ) {
188164 e = float64ToFloat32 ( expected [ i ] ) ;
189165 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
190- delta = absf ( v - e ) ;
191- tol = EPS * absf ( e ) ;
192- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
166+ t . strictEqual ( v , e , 'returns expected value' ) ;
193167 }
194168 t . end ( ) ;
195169} ) ;
196170
197171tape ( 'the function evaluates the modulus function (negative `x`, negative `y`)' , opts , function test ( t ) {
198172 var expected ;
199- var delta ;
200- var tol ;
201173 var v ;
202174 var x ;
203175 var y ;
@@ -210,9 +182,7 @@ tape( 'the function evaluates the modulus function (negative `x`, negative `y`)'
210182 for ( i = 0 ; i < x . length ; i ++ ) {
211183 e = float64ToFloat32 ( expected [ i ] ) ;
212184 v = fmodf ( float64ToFloat32 ( x [ i ] ) , float64ToFloat32 ( y [ i ] ) ) ;
213- delta = absf ( v - e ) ;
214- tol = EPS * absf ( e ) ;
215- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. y: ' + y [ i ] + '. v: ' + v + '. E: ' + e + '. Δ: ' + delta + '. tol: ' + tol ) ;
185+ t . strictEqual ( v , e , 'returns expected value' ) ;
216186 }
217187 t . end ( ) ;
218188} ) ;
0 commit comments