Skip to content

Commit b6223fa

Browse files
committed
Auto-generated commit
1 parent 8691a3c commit b6223fa

4 files changed

Lines changed: 64 additions & 101 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ A total of 46 issues were closed in this release:
499499

500500
<details>
501501

502+
- [`a2cfe0e`](https://github.com/stdlib-js/stdlib/commit/a2cfe0e3fe5167301372d22dbae8e8b19917f77c) - **test:** update test messages according to current project conventions _(by Karan Anand)_
503+
- [`c5ccaff`](https://github.com/stdlib-js/stdlib/commit/c5ccaff1e7697684168c649fd87882b259664c73) - **test:** remove the use of `IS_BROWSER` from test files _(by Karan Anand)_
502504
- [`7bb31ea`](https://github.com/stdlib-js/stdlib/commit/7bb31ea0bb5ffce51b472c32e2867396e92f406a) - **docs:** update related packages sections [(#7328)](https://github.com/stdlib-js/stdlib/pull/7328) _(by stdlib-bot, Athan Reines)_
503505
- [`6ae353c`](https://github.com/stdlib-js/stdlib/commit/6ae353c5461eb9f83e61af1bb87d9a1ffa14279e) - **feat:** add C implementation for `math/base/special/ellipj` [(#6965)](https://github.com/stdlib-js/stdlib/pull/6965) _(by Karan Anand, Philipp Burckhardt)_
504506
- [`8c519dd`](https://github.com/stdlib-js/stdlib/commit/8c519ddfafd9e87c7633c9e0555d59bb752aac7b) - **feat:** add `math/base/special/coversinf` [(#7316)](https://github.com/stdlib-js/stdlib/pull/7316) _(by Karan Anand)_

base/special/frexp/test/test.assign.js

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
2524
var NINF = require( '@stdlib/constants/float64/ninf' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
@@ -63,8 +62,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
6362
for ( i = 0; i < x.length; i++ ) {
6463
out = new Float64Array( 2 );
6564
f = frexp( x[i], out, 1, 0 );
66-
t.equal( f, out, 'returns output array' );
67-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
65+
t.strictEqual( f, out, 'returns output array' );
66+
t.deepEqual( f, expected[ i ], 'returns expected value' );
6867
}
6968
t.end();
7069
});
@@ -81,8 +80,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
8180
for ( i = 0; i < x.length; i++ ) {
8281
out = new Float64Array( 2 );
8382
f = frexp( x[i], out, 1, 0 );
84-
t.equal( f, out, 'returns output array' );
85-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
83+
t.strictEqual( f, out, 'returns output array' );
84+
t.deepEqual( f, expected[ i ], 'returns expected value' );
8685
}
8786
t.end();
8887
});
@@ -99,8 +98,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
9998
for ( i = 0; i < x.length; i++ ) {
10099
out = new Float64Array( 2 );
101100
f = frexp( x[i], out, 1, 0 );
102-
t.equal( f, out, 'returns output array' );
103-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
101+
t.strictEqual( f, out, 'returns output array' );
102+
t.deepEqual( f, expected[ i ], 'returns expected value' );
104103
}
105104
t.end();
106105
});
@@ -117,14 +116,13 @@ tape( 'the function splits a floating-point number into a normalized fraction an
117116
for ( i = 0; i < x.length; i++ ) {
118117
out = new Float64Array( 2 );
119118
f = frexp( x[i], out, 1, 0 );
120-
t.equal( f, out, 'returns output array' );
121-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
119+
t.strictEqual( f, out, 'returns output array' );
120+
t.deepEqual( f, expected[ i ], 'returns expected value' );
122121
}
123122
t.end();
124123
});
125124

126125
tape( 'the returned normalized fraction and exponent satisfy the relation `x = frac * 2**exp`', function test( t ) {
127-
var total;
128126
var sign;
129127
var frac;
130128
var exp;
@@ -133,12 +131,7 @@ tape( 'the returned normalized fraction and exponent satisfy the relation `x = f
133131
var f;
134132
var i;
135133

136-
if ( IS_BROWSER ) {
137-
total = 200;
138-
} else {
139-
total = 1000;
140-
}
141-
for ( i = 0; i < total; i++ ) {
134+
for ( i = 0; i < 1000; i++ ) {
142135
if ( randu() < 0.5 ) {
143136
sign = -1.0;
144137
} else {
@@ -149,20 +142,19 @@ tape( 'the returned normalized fraction and exponent satisfy the relation `x = f
149142
x = sign * frac * pow( 10.0, exp );
150143
out = new Float64Array( 2 );
151144
f = frexp( x, out, 1, 0 );
152-
t.equal( f, out, 'returns output array' );
145+
t.strictEqual( f, out, 'returns output array' );
153146

154147
if ( f[ 1 ] > BIAS ) {
155148
f = f[ 0 ] * pow( 2.0, BIAS ) * pow( 2.0, f[1]-BIAS );
156149
} else {
157150
f = f[ 0 ] * pow( 2.0, f[ 1 ] );
158151
}
159-
t.equal( f, x, 'frac * 2^exp equals ' + x );
152+
t.strictEqual( f, x, 'returns expected value' );
160153
}
161154
t.end();
162155
});
163156

164157
tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)`', function test( t ) {
165-
var total;
166158
var sign;
167159
var frac;
168160
var exp;
@@ -171,12 +163,7 @@ tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)
171163
var f;
172164
var i;
173165

174-
if ( IS_BROWSER ) {
175-
total = 200;
176-
} else {
177-
total = 1000;
178-
}
179-
for ( i = 0; i < total; i++ ) {
166+
for ( i = 0; i < 1000; i++ ) {
180167
if ( randu() < 0.5 ) {
181168
sign = -1.0;
182169
} else {
@@ -187,11 +174,11 @@ tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)
187174
x = sign * frac * pow( 10.0, exp );
188175
out = new Float64Array( 2 );
189176
f = frexp( x, out, 1, 0 );
190-
t.equal( f, out, 'returns output array' );
177+
t.strictEqual( f, out, 'returns output array' );
191178

192179
// Compute the absolute value of the normalized fraction:
193180
f = abs( f[ 0 ] );
194-
t.ok( f >= 0.5 && f < 1.0, 'absolute value of the normalized fraction is on the interval [1/2,1). x: ' + x + '.' );
181+
t.ok( f >= 0.5 && f < 1.0, 'returns expected value' );
195182
}
196183
t.end();
197184
});
@@ -202,8 +189,8 @@ tape( 'if provided `+0`, the function returns `[0,0]`', function test( t ) {
202189

203190
out = new Float64Array( 2 );
204191
f = frexp( 0.0, out, 1, 0 );
205-
t.equal( f, out, 'returns output array' );
206-
t.deepEqual( f, [0.0, 0], 'returns [0,0]' );
192+
t.strictEqual( f, out, 'returns output array' );
193+
t.deepEqual( f, [ 0.0, 0 ], 'returns expected value' );
207194
t.end();
208195
});
209196

@@ -213,9 +200,9 @@ tape( 'if provided `-0`, the function returns `[-0,0]`', function test( t ) {
213200

214201
out = new Float64Array( 2 );
215202
f = frexp( -0.0, out, 1, 0 );
216-
t.equal( f, out, 'returns output array' );
217-
t.equal( isNegativeZero( f[0] ), true, 'first element is -0' );
218-
t.deepEqual( f, [-0.0, 0], 'returns [-0,0]' );
203+
t.strictEqual( f, out, 'returns output array' );
204+
t.strictEqual( isNegativeZero( f[0] ), true, 'returns expected value' );
205+
t.deepEqual( f, [ -0.0, 0 ], 'returns expected value' );
219206
t.end();
220207
});
221208

@@ -225,8 +212,8 @@ tape( 'if provided `+infinity`, the function returns `[+infinity,0]`', function
225212

226213
out = new Float64Array( 2 );
227214
f = frexp( PINF, out, 1, 0 );
228-
t.equal( f, out, 'returns output array' );
229-
t.deepEqual( f, [PINF, 0], 'returns [+inf,0]' );
215+
t.strictEqual( f, out, 'returns output array' );
216+
t.deepEqual( f, [ PINF, 0 ], 'returns expected value' );
230217
t.end();
231218
});
232219

@@ -236,8 +223,8 @@ tape( 'if provided `-infinity`, the function returns `[-infinity,0]`', function
236223

237224
out = new Float64Array( 2 );
238225
f = frexp( NINF, out, 1, 0 );
239-
t.equal( f, out, 'returns output array' );
240-
t.deepEqual( f, [NINF, 0], 'returns [-inf,0]' );
226+
t.strictEqual( f, out, 'returns output array' );
227+
t.deepEqual( f, [ NINF, 0 ], 'returns expected value' );
241228
t.end();
242229
});
243230

@@ -247,9 +234,9 @@ tape( 'if provided `NaN`, the function returns `[NaN,0]`', function test( t ) {
247234

248235
out = new Float64Array( 2 );
249236
f = frexp( NaN, out, 1, 0 );
250-
t.equal( f, out, 'returns output array' );
251-
t.equal( isnan( f[0] ), true, 'first element is NaN' );
252-
t.equal( f[ 1 ], 0, 'second element is 0' );
237+
t.strictEqual( f, out, 'returns output array' );
238+
t.strictEqual( isnan( f[0] ), true, 'returns expected value' );
239+
t.strictEqual( f[ 1 ], 0, 'returns expected value' );
253240
t.end();
254241
});
255242

@@ -260,9 +247,9 @@ tape( 'the function supports providing an output array', function test( t ) {
260247
out = [ 0.0, 0 ];
261248
f = frexp( 4.0, out, 1, 0 );
262249

263-
t.equal( f, out, 'returns output array' );
264-
t.equal( f[ 0 ], 0.5, 'has expected first element' );
265-
t.equal( f[ 1 ], 3, 'has expected second element' );
250+
t.strictEqual( f, out, 'returns output array' );
251+
t.strictEqual( f[ 0 ], 0.5, 'returns expected value' );
252+
t.strictEqual( f[ 1 ], 3, 'returns expected value' );
266253

267254
t.end();
268255
});
@@ -274,9 +261,9 @@ tape( 'the function supports providing an output typed array', function test( t
274261
out = new Float64Array( 2 );
275262
f = frexp( 4.0, out, 1, 0 );
276263

277-
t.equal( f, out, 'returns output array' );
278-
t.equal( f[ 0 ], 0.5, 'has expected first element' );
279-
t.equal( f[ 1 ], 3, 'has expected second element' );
264+
t.strictEqual( f, out, 'returns output array' );
265+
t.strictEqual( f[ 0 ], 0.5, 'returns expected value' );
266+
t.strictEqual( f[ 1 ], 3, 'returns expected value' );
280267

281268
t.end();
282269
});

base/special/frexp/test/test.main.js

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
2524
var NINF = require( '@stdlib/constants/float64/ninf' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
@@ -60,7 +59,7 @@ tape( 'the function splits a floating-point number into a normalized fraction an
6059
expected = small.expected;
6160
for ( i = 0; i < x.length; i++ ) {
6261
f = frexp( x[i] );
63-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
62+
t.deepEqual( f, expected[ i ], 'returns expected value' );
6463
}
6564
t.end();
6665
});
@@ -75,7 +74,7 @@ tape( 'the function splits a floating-point number into a normalized fraction an
7574
expected = medium.expected;
7675
for ( i = 0; i < x.length; i++ ) {
7776
f = frexp( x[i] );
78-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
77+
t.deepEqual( f, expected[ i ], 'returns expected value' );
7978
}
8079
t.end();
8180
});
@@ -90,7 +89,7 @@ tape( 'the function splits a floating-point number into a normalized fraction an
9089
expected = large.expected;
9190
for ( i = 0; i < x.length; i++ ) {
9291
f = frexp( x[i] );
93-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
92+
t.deepEqual( f, expected[ i ], 'returns expected value' );
9493
}
9594
t.end();
9695
});
@@ -105,26 +104,20 @@ tape( 'the function splits a floating-point number into a normalized fraction an
105104
expected = subnormal.expected;
106105
for ( i = 0; i < x.length; i++ ) {
107106
f = frexp( x[i] );
108-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
107+
t.deepEqual( f, expected[ i ], 'returns expected value' );
109108
}
110109
t.end();
111110
});
112111

113112
tape( 'the returned normalized fraction and exponent satisfy the relation `x = frac * 2**exp`', function test( t ) {
114-
var total;
115113
var sign;
116114
var frac;
117115
var exp;
118116
var x;
119117
var f;
120118
var i;
121119

122-
if ( IS_BROWSER ) {
123-
total = 200;
124-
} else {
125-
total = 1000;
126-
}
127-
for ( i = 0; i < total; i++ ) {
120+
for ( i = 0; i < 1000; i++ ) {
128121
if ( randu() < 0.5 ) {
129122
sign = -1.0;
130123
} else {
@@ -140,26 +133,20 @@ tape( 'the returned normalized fraction and exponent satisfy the relation `x = f
140133
} else {
141134
f = f[ 0 ] * pow( 2.0, f[ 1 ] );
142135
}
143-
t.equal( f, x, 'frac * 2^exp equals ' + x );
136+
t.strictEqual( f, x, 'returns expected value' );
144137
}
145138
t.end();
146139
});
147140

148141
tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)`', function test( t ) {
149-
var total;
150142
var sign;
151143
var frac;
152144
var exp;
153145
var x;
154146
var f;
155147
var i;
156148

157-
if ( IS_BROWSER ) {
158-
total = 200;
159-
} else {
160-
total = 1000;
161-
}
162-
for ( i = 0; i < total; i++ ) {
149+
for ( i = 0; i < 1000; i++ ) {
163150
if ( randu() < 0.5 ) {
164151
sign = -1.0;
165152
} else {
@@ -173,39 +160,39 @@ tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)
173160
// Compute the absolute value of the normalized fraction:
174161
f = abs( f[ 0 ] );
175162

176-
t.ok( f >= 0.5 && f < 1.0, 'absolute value of the normalized fraction is on the interval [1/2,1). x: ' + x + '.' );
163+
t.ok( f >= 0.5 && f < 1.0, 'returns expected value' );
177164
}
178165
t.end();
179166
});
180167

181168
tape( 'if provided `+0`, the function returns `[0,0]`', function test( t ) {
182169
var f = frexp( 0.0 );
183-
t.deepEqual( f, [0.0, 0], 'returns [0,0]' );
170+
t.deepEqual( f, [ 0.0, 0 ], 'returns expected value' );
184171
t.end();
185172
});
186173

187174
tape( 'if provided `-0`, the function returns `[-0,0]`', function test( t ) {
188175
var f = frexp( -0.0 );
189-
t.equal( isNegativeZero( f[0] ), true, 'first element is -0' );
190-
t.deepEqual( f, [-0.0, 0], 'returns [-0,0]' );
176+
t.strictEqual( isNegativeZero( f[0] ), true, 'first element is -0' );
177+
t.deepEqual( f, [ -0.0, 0 ], 'returns expected value' );
191178
t.end();
192179
});
193180

194181
tape( 'if provided `+infinity`, the function returns `[+infinity,0]`', function test( t ) {
195182
var f = frexp( PINF );
196-
t.deepEqual( f, [PINF, 0], 'returns [+inf,0]' );
183+
t.deepEqual( f, [ PINF, 0 ], 'returns expected value' );
197184
t.end();
198185
});
199186

200187
tape( 'if provided `-infinity`, the function returns `[-infinity,0]`', function test( t ) {
201188
var f = frexp( NINF );
202-
t.deepEqual( f, [NINF, 0], 'returns [-inf,0]' );
189+
t.deepEqual( f, [ NINF, 0 ], 'returns expected value' );
203190
t.end();
204191
});
205192

206193
tape( 'if provided `NaN`, the function returns `[NaN,0]`', function test( t ) {
207194
var f = frexp( NaN );
208-
t.equal( isnan( f[0] ), true, 'first element is NaN' );
209-
t.equal( f[ 1 ], 0, 'second element is 0' );
195+
t.strictEqual( isnan( f[0] ), true, 'returns expected value' );
196+
t.strictEqual( f[ 1 ], 0, 'returns expected value' );
210197
t.end();
211198
});

0 commit comments

Comments
 (0)