Skip to content

Commit 1279aae

Browse files
Merge branch 'stdlib-js:develop' into feat/sincosd
2 parents ed3fb64 + aec0e88 commit 1279aae

File tree

142 files changed

+7252
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+7252
-277
lines changed

.github/workflows/scripts/rate_limit_contributions

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,17 @@ main() {
123123
pr_details=$(github_api "GET" "/repos/${repo_owner}/${repo_name}/pulls/${pr_number}")
124124
good_first_pr=$(echo "${pr_details}" | jq -r '.labels | any(.name == "Good First PR")')
125125

126+
# Check if the PR is labeled "Good First PR":
127+
if [ "${good_first_pr}" != "true" ]; then
128+
echo "PR is not labeled 'Good First PR'."
129+
print_success
130+
exit 0
131+
fi
132+
126133
pr_author=$(echo "${pr_details}" | jq -r '.user.login')
127134

128135
# Fetch other PRs of the same user:
129-
user_prs=$(github_api "GET" "/search/issues?q=state%3Aopen+author%3A${pr_author}+type%3Apr")
136+
user_prs=$(github_api "GET" "/search/issues?q=repo%3A${repo_owner}%2F${repo_name}+state%3Aopen+author%3A${pr_author}+type%3Apr")
130137

131138
# Count number of PRs labeled "Good First PR":
132139
num_good_first_prs=$(echo "${user_prs}" | jq -r '.items | map( select( .labels | any( .name == "Good First PR" ))) | length')

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Aleksandr <[email protected]>
1818
Ali Salesi <[email protected]>
1919
Aman Bhansali <[email protected]>
2020
Amit Jimiwal <[email protected]>
21+
Anshu Kumar <[email protected]>
2122
Anudeep Sanapala <[email protected]>
2223
Athan Reines <[email protected]>
2324
@@ -49,6 +50,7 @@ Gururaj Gurram <[email protected]>
4950
5051
5152
Harshita Kalani <[email protected]>
53+
Hemant M Mehta <[email protected]>
5254
Hridyanshu <[email protected]>
5355
Jaimin Godhani <[email protected]>
5456
Jalaj Kumar <[email protected]>

lib/node_modules/@stdlib/assert/is-electron-main/lib/process.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var process = require( 'process' );
24+
25+
2126
// EXPORTS //
2227

2328
module.exports = process;

lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/benchmark.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,22 @@ static double rand_double( void ) {
8989
* @return elapsed time in seconds
9090
*/
9191
static double benchmark( void ) {
92+
double re[ 100 ];
93+
double im[ 100 ];
9294
double elapsed;
93-
double re;
94-
double im;
9595
double t;
9696
int i;
9797

9898
double complex z;
9999

100+
for ( i = 0; i < 100; i++ ) {
101+
re[ i ] = ( 100.0*rand_double() ) - 50.0;
102+
im[ i ] = ( 100.0*rand_double() ) - 50.0;
103+
}
104+
100105
t = tic();
101106
for ( i = 0; i < ITERATIONS; i++ ) {
102-
re = ( 100.0*rand_double() ) - 50.0;
103-
im = ( 100.0*rand_double() ) - 50.0;
104-
105-
z = ( cos( re ) + I * sin( re ) ) / exp( im );
107+
z = ( cos( re[ i%100 ] ) + I * sin( re[ i%100 ] ) ) / exp( im[ i%100 ] );
106108
if ( z != z ) {
107109
printf( "should not return NaN\n" );
108110
break;

lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/native/benchmark.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,26 @@ static double rand_double( void ) {
9292
* @return elapsed time in seconds
9393
*/
9494
static double benchmark( void ) {
95+
double re[ 100 ];
96+
double im[ 100 ];
9597
double elapsed;
96-
double re;
97-
double im;
9898
double t;
9999
int i;
100100

101101
stdlib_complex128_t z1;
102102
stdlib_complex128_t z2;
103103

104+
for ( i = 0; i < 100; i++ ) {
105+
re[ i ] = ( 1000.0*rand_double() ) - 500.0;
106+
im[ i ] = ( 1000.0*rand_double() ) - 500.0;
107+
}
108+
104109
t = tic();
105110
for ( i = 0; i < ITERATIONS; i++ ) {
106-
re = ( 1000.0*rand_double() ) - 500.0;
107-
im = ( 1000.0*rand_double() ) - 500.0;
108-
z1 = stdlib_complex128( re, im );
111+
z1 = stdlib_complex128( re[ i%100 ], im[ i%100 ] );
109112

110113
z2 = stdlib_base_ccis( z1 );
111-
stdlib_complex128_reim( z2, &re, &im );
114+
stdlib_complex128_reim( z2, &re[ i%100 ], &im[ i%100 ] );
112115
if ( re != re ) {
113116
printf( "should not return NaN\n" );
114117
break;

lib/node_modules/@stdlib/math/base/special/ccis/test/test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,17 @@ tape( 'if real component is `+Infinity`, all components are `NaN`', function tes
139139
var v;
140140

141141
v = ccis( new Complex128( PINF, 0.0 ) );
142-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
143-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
142+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
143+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
144144
t.end();
145145
});
146146

147147
tape( 'if real component is `-Infinity`, all components are `NaN`', function test( t ) {
148148
var v;
149149

150150
v = ccis( new Complex128( NINF, 0.0 ) );
151-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
152-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
151+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
152+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
153153
t.end();
154154
});
155155

@@ -171,24 +171,24 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct
171171
t.strictEqual( real( v ), PINF, 'returns +Infinity' );
172172

173173
// The imaginary component is computed as Infinity * 0.0 = NaN:
174-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
174+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
175175
t.end();
176176
});
177177

178178
tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) {
179179
var v;
180180

181181
v = ccis( new Complex128( NaN, 3.0 ) );
182-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
183-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
182+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
183+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
184184

185185
v = ccis( new Complex128( 5.0, NaN ) );
186-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
187-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
186+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
187+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
188188

189189
v = ccis( new Complex128( NaN, NaN ) );
190-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
191-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
190+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
191+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
192192

193193
t.end();
194194
});

lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ tape( 'if real component is `+Infinity`, all components are `NaN`', opts, functi
149149
var v;
150150

151151
v = ccis( new Complex128( PINF, 0.0 ) );
152-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
153-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
152+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
153+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
154154
t.end();
155155
});
156156

157157
tape( 'if real component is `-Infinity`, all components are `NaN`', opts, function test( t ) {
158158
var v;
159159

160160
v = ccis( new Complex128( NINF, 0.0 ) );
161-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
162-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
161+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
162+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
163163
t.end();
164164
});
165165

@@ -181,24 +181,24 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct
181181
t.strictEqual( real( v ), PINF, 'returns +Infinity' );
182182

183183
// The imaginary component is computed as Infinity * 0.0 = NaN:
184-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
184+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
185185
t.end();
186186
});
187187

188188
tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) {
189189
var v;
190190

191191
v = ccis( new Complex128( NaN, 3.0 ) );
192-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
193-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
192+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
193+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
194194

195195
v = ccis( new Complex128( 5.0, NaN ) );
196-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
197-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
196+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
197+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
198198

199199
v = ccis( new Complex128( NaN, NaN ) );
200-
t.strictEqual( isnan( real( v ) ), true, 'returns NaN' );
201-
t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );
200+
t.strictEqual( isnan( real( v ) ), true, 'returns expected value' );
201+
t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' );
202202

203203
t.end();
204204
});

lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.js

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

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pkg = require( './../package.json' ).name;
2727
var ceil = require( './../lib' );
@@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) {
3434
var y;
3535
var i;
3636

37+
x = uniform( 100, -500.0, 500.0 );
38+
3739
b.tic();
3840
for ( i = 0; i < b.iterations; i++ ) {
39-
x = ( randu()*1000.0 ) - 500.0;
40-
y = ceil( x );
41+
y = ceil( x[ i%x.length ] );
4142
if ( isnan( y ) ) {
4243
b.fail( 'should not return NaN' );
4344
}
@@ -55,10 +56,11 @@ bench( pkg+'::built-in', function benchmark( b ) {
5556
var y;
5657
var i;
5758

59+
x = uniform( 100, -500.0, 500.0 );
60+
5861
b.tic();
5962
for ( i = 0; i < b.iterations; i++ ) {
60-
x = ( randu()*1000.0 ) - 500.0;
61-
y = Math.ceil( x ); // eslint-disable-line stdlib/no-builtin-math
63+
y = Math.ceil( x[ i%x.length ] ); // eslint-disable-line stdlib/no-builtin-math
6264
if ( isnan( y ) ) {
6365
b.fail( 'should not return NaN' );
6466
}

lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.native.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var randu = require( '@stdlib/random/base/randu' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
2828
var pkg = require( './../package.json' ).name;
@@ -43,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4343
var y;
4444
var i;
4545

46+
x = uniform( 100, -500.0, 500.0 );
47+
4648
b.tic();
4749
for ( i = 0; i < b.iterations; i++ ) {
48-
x = ( randu()*1000.0 ) - 500.0;
49-
y = ceil( x );
50+
y = ceil( x[ i%x.length ] );
5051
if ( isnan( y ) ) {
5152
b.fail( 'should not return NaN' );
5253
}

lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/benchmark.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,19 @@ static double rand_double( void ) {
8989
* @return elapsed time in seconds
9090
*/
9191
static double benchmark( void ) {
92+
double x[ 100 ];
9293
double elapsed;
93-
double x;
9494
double y;
9595
double t;
9696
int i;
9797

98+
for ( i = 0; i < 100; i++ ) {
99+
x[ i ] = ( 1000.0*rand_double() ) - 500.0;
100+
}
101+
98102
t = tic();
99103
for ( i = 0; i < ITERATIONS; i++ ) {
100-
x = ( 1000.0*rand_double() ) - 500.0;
101-
y = ceil( x );
104+
y = ceil( x[ i%100 ] );
102105
if ( y != y ) {
103106
printf( "should not return NaN\n" );
104107
break;

0 commit comments

Comments
 (0)