Skip to content

Commit 7d49895

Browse files
committed
Auto-generated commit
1 parent dfb0dd9 commit 7d49895

3 files changed

Lines changed: 15 additions & 74 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<details>
1414

15+
- [`d391b04`](https://github.com/stdlib-js/stdlib/commit/d391b0458eaf0d05c3549414f7d5e8894a86be6d) - **test:** migrate `math/base/special/fmodf` to ULP-based testing [(#12791)](https://github.com/stdlib-js/stdlib/pull/12791) _(by Philipp Burckhardt)_
1516
- [`c47223b`](https://github.com/stdlib-js/stdlib/commit/c47223b2050d866afb3dfbca514ff665f3dabcb5) - **test:** migrate `math/base/special/kernel-tanf` to ULP-based testing [(#12793)](https://github.com/stdlib-js/stdlib/pull/12793) _(by Philipp Burckhardt)_
1617
- [`63254e7`](https://github.com/stdlib-js/stdlib/commit/63254e70389d0a02d3c39231dbc8bbf98b2cca2c) - **test:** migrate `math/base/special/riemann-zeta` to ULP-based testing [(#12809)](https://github.com/stdlib-js/stdlib/pull/12809) _(by Philipp Burckhardt)_
1718
- [`5d9b083`](https://github.com/stdlib-js/stdlib/commit/5d9b083eb17e79057568c9fce7e54a7ee69eb98d) - **test:** migrate `math/base/special/cflipsign` to ULP-based testing [(#12766)](https://github.com/stdlib-js/stdlib/pull/12766) _(by Philipp Burckhardt)_

base/special/fmodf/test/test.js

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
var tape = require( 'tape' );
2424
var isnanf = require( './../../../../base/assert/is-nanf' );
2525
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
26-
var absf = require( './../../../../base/special/absf' );
27-
var EPS = require( '@stdlib/constants/float32/eps' );
2826
var fmodf = require( './../lib' );
2927

3028

@@ -49,8 +47,6 @@ tape( 'main export is a function', function test( t ) {
4947

5048
tape( 'the function evaluates the modulus function (subnormal results)', function test( t ) {
5149
var expected;
52-
var delta;
53-
var tol;
5450
var v;
5551
var x;
5652
var y;
@@ -63,17 +59,13 @@ tape( 'the function evaluates the modulus function (subnormal results)', functio
6359
for ( i = 0; i < x.length; i++ ) {
6460
e = float64ToFloat32( expected[ i ] );
6561
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
66-
delta = absf( v - e );
67-
tol = EPS * absf( e );
68-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
62+
t.strictEqual( v, e, 'returns expected value' );
6963
}
7064
t.end();
7165
});
7266

7367
tape( 'the function evaluates the modulus function (small `x`, large `y`)', function test( t ) {
7468
var expected;
75-
var delta;
76-
var tol;
7769
var v;
7870
var x;
7971
var y;
@@ -86,17 +78,13 @@ tape( 'the function evaluates the modulus function (small `x`, large `y`)', func
8678
for ( i = 0; i < x.length; i++ ) {
8779
e = float64ToFloat32( expected[ i ] );
8880
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
89-
delta = absf( v - e );
90-
tol = EPS * absf( e );
91-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
81+
t.strictEqual( v, e, 'returns expected value' );
9282
}
9383
t.end();
9484
});
9585

9686
tape( 'the function evaluates the modulus function (large `x`, small `y`)', function test( t ) {
9787
var expected;
98-
var delta;
99-
var tol;
10088
var v;
10189
var x;
10290
var y;
@@ -109,17 +97,13 @@ tape( 'the function evaluates the modulus function (large `x`, small `y`)', func
10997
for ( i = 0; i < x.length; i++ ) {
11098
e = float64ToFloat32( expected[ i ] );
11199
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
112-
delta = absf( v - e );
113-
tol = EPS * absf( e );
114-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
100+
t.strictEqual( v, e, 'returns expected value' );
115101
}
116102
t.end();
117103
});
118104

119105
tape( 'the function evaluates the modulus function (small `x`, small `y`)', function test( t ) {
120106
var expected;
121-
var delta;
122-
var tol;
123107
var v;
124108
var x;
125109
var y;
@@ -132,17 +116,13 @@ tape( 'the function evaluates the modulus function (small `x`, small `y`)', func
132116
for ( i = 0; i < x.length; i++ ) {
133117
e = float64ToFloat32( expected[ i ] );
134118
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
135-
delta = absf( v - e );
136-
tol = EPS * absf( e );
137-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
119+
t.strictEqual( v, e, 'returns expected value' );
138120
}
139121
t.end();
140122
});
141123

142124
tape( 'the function evaluates the modulus function (positive `x`, negative `y`)', function test( t ) {
143125
var expected;
144-
var delta;
145-
var tol;
146126
var v;
147127
var x;
148128
var y;
@@ -155,17 +135,13 @@ tape( 'the function evaluates the modulus function (positive `x`, negative `y`)'
155135
for ( i = 0; i < x.length; i++ ) {
156136
e = float64ToFloat32( expected[ i ] );
157137
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
158-
delta = absf( v - e );
159-
tol = EPS * absf( e );
160-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
138+
t.strictEqual( v, e, 'returns expected value' );
161139
}
162140
t.end();
163141
});
164142

165143
tape( 'the function evaluates the modulus function (negative `x`, positive `y`)', function test( t ) {
166144
var expected;
167-
var delta;
168-
var tol;
169145
var v;
170146
var x;
171147
var y;
@@ -178,17 +154,13 @@ tape( 'the function evaluates the modulus function (negative `x`, positive `y`)'
178154
for ( i = 0; i < x.length; i++ ) {
179155
e = float64ToFloat32( expected[ i ] );
180156
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
181-
delta = absf( v - e );
182-
tol = EPS * absf( e );
183-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
157+
t.strictEqual( v, e, 'returns expected value' );
184158
}
185159
t.end();
186160
});
187161

188162
tape( 'the function evaluates the modulus function (negative `x`, negative `y`)', function test( t ) {
189163
var expected;
190-
var delta;
191-
var tol;
192164
var v;
193165
var x;
194166
var y;
@@ -201,9 +173,7 @@ tape( 'the function evaluates the modulus function (negative `x`, negative `y`)'
201173
for ( i = 0; i < x.length; i++ ) {
202174
e = float64ToFloat32( expected[ i ] );
203175
v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) );
204-
delta = absf( v - e );
205-
tol = EPS * absf( e );
206-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol );
176+
t.strictEqual( v, e, 'returns expected value' );
207177
}
208178
t.end();
209179
});

base/special/fmodf/test/test.native.js

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var isnanf = require( './../../../../base/assert/is-nanf' );
2626
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
27-
var absf = require( './../../../../base/special/absf' );
28-
var EPS = require( '@stdlib/constants/float32/eps' );
2927
var tryRequire = require( '@stdlib/utils/try-require' );
3028

3129

@@ -58,8 +56,6 @@ tape( 'main export is a function', opts, function test( t ) {
5856

5957
tape( '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

8276
tape( '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

10595
tape( '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

128114
tape( '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

151133
tape( '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

174152
tape( '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

197171
tape( '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

Comments
 (0)