Skip to content

Commit 3850f8e

Browse files
committed
refactor: apply suggestions from previous PRs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent f407e42 commit 3850f8e

File tree

10 files changed

+403
-411
lines changed

10 files changed

+403
-411
lines changed

lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ for ( i = 0; i < 10; i++ ) {
159159

160160
#### stdlib_base_dists_arcsine_skewness( a, b )
161161

162-
Returns the skewness of an arcsine distribution.
162+
Returns the [skewness][skewness] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support).
163163

164164
```c
165165
double out = stdlib_base_dists_arcsine_skewness( 4.0, 12.0 );
@@ -213,11 +213,8 @@ int main( void ) {
213213
a = random_uniform( -20.0, 0.0 );
214214
b = random_uniform( a, a + 40.0 );
215215
s = stdlib_base_dists_arcsine_skewness( a, b );
216-
217-
printf( "a: %lf, b: %lf, Skewness: %lf\n", a, b, s );
216+
printf( "a: %lf, b: %lf, skew(X;a,b): %lf\n", a, b, s );
218217
}
219-
220-
return 0;
221218
}
222219
```
223220

lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/benchmark/benchmark.native.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/**
2-
* @license Apache-2.0
3-
*
4-
* Copyright (c) 2025 The Stdlib Authors.
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
1818

1919
'use strict';
2020

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/**
2-
* @license Apache-2.0
3-
*
4-
* Copyright (c) 2025 The Stdlib Authors.
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
1818

1919
#include "stdlib/stats/base/dists/arcsine/skewness.h"
20-
#include <stdlib.h>
2120
#include <stdio.h>
21+
#include <stdlib.h>
2222
#include <time.h>
2323
#include <sys/time.h>
2424

@@ -30,7 +30,7 @@
3030
* Prints the TAP version.
3131
*/
3232
static void print_version( void ) {
33-
printf( "TAP version 13\n" );
33+
printf( "TAP version 13\n" );
3434
}
3535

3636
/**
@@ -40,12 +40,12 @@ static void print_version( void ) {
4040
* @param passing total number of passing tests
4141
*/
4242
static void print_summary( int total, int passing ) {
43-
printf( "#\n" );
44-
printf( "1..%d\n", total ); // TAP plan
45-
printf( "# total %d\n", total );
46-
printf( "# pass %d\n", passing );
47-
printf( "#\n" );
48-
printf( "# ok\n" );
43+
printf( "#\n" );
44+
printf( "1..%d\n", total ); // TAP plan
45+
printf( "# total %d\n", total );
46+
printf( "# pass %d\n", passing );
47+
printf( "#\n" );
48+
printf( "# ok\n" );
4949
}
5050

5151
/**
@@ -54,12 +54,12 @@ static void print_summary( int total, int passing ) {
5454
* @param elapsed elapsed time in seconds
5555
*/
5656
static void print_results( double elapsed ) {
57-
double rate = (double)ITERATIONS / elapsed;
58-
printf( " ---\n" );
59-
printf( " iterations: %d\n", ITERATIONS );
60-
printf( " elapsed: %0.9f\n", elapsed );
61-
printf( " rate: %0.9f\n", rate );
62-
printf( " ...\n" );
57+
double rate = (double)ITERATIONS / elapsed;
58+
printf( " ---\n" );
59+
printf( " iterations: %d\n", ITERATIONS );
60+
printf( " elapsed: %0.9f\n", elapsed );
61+
printf( " rate: %0.9f\n", rate );
62+
printf( " ...\n" );
6363
}
6464

6565
/**
@@ -68,9 +68,9 @@ static void print_results( double elapsed ) {
6868
* @return clock time
6969
*/
7070
static double tic( void ) {
71-
struct timeval now;
72-
gettimeofday( &now, NULL );
73-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
71+
struct timeval now;
72+
gettimeofday( &now, NULL );
73+
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
7474
}
7575

7676
/**
@@ -81,8 +81,8 @@ static double tic( void ) {
8181
* @return random number
8282
*/
8383
static double random_uniform( const double min, const double max ) {
84-
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
85-
return min + ( v*(max-min) );
84+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
85+
return min + ( v * ( max - min ) );
8686
}
8787

8888
/**
@@ -91,49 +91,49 @@ static double random_uniform( const double min, const double max ) {
9191
* @return elapsed time in seconds
9292
*/
9393
static double benchmark( void ) {
94-
double elapsed;
95-
double a[ 100 ];
96-
double b[ 100 ];
97-
double y;
98-
double t;
99-
int i;
94+
double elapsed;
95+
double a[ 100 ];
96+
double b[ 100 ];
97+
double y;
98+
double t;
99+
int i;
100100

101-
for ( i = 0; i < 100; i++ ) {
102-
a[ i ] = random_uniform( -20.0, 0.0 );
103-
b[ i ] = random_uniform( a[ i ], a[ i ]+40.0 );
104-
}
101+
for ( i = 0; i < 100; i++ ) {
102+
a[ i ] = random_uniform( -20.0, 0.0 );
103+
b[ i ] = random_uniform( a[ i ], a[ i ] + 40.0 );
104+
}
105105

106-
t = tic();
107-
for ( i = 0; i < ITERATIONS; i++ ) {
108-
y = stdlib_base_dists_arcsine_skewness( a[ i%100 ], b[ i%100 ] );
109-
if ( y != y ) {
110-
printf( "should not return NaN\n" );
111-
break;
112-
}
113-
}
114-
elapsed = tic() - t;
115-
if ( y != y ) {
116-
printf( "should not return NaN\n" );
117-
}
118-
return elapsed;
106+
t = tic();
107+
for ( i = 0; i < ITERATIONS; i++ ) {
108+
y = stdlib_base_dists_arcsine_skewness( a[ i % 100 ], b[ i % 100 ] );
109+
if ( y != y ) {
110+
printf( "should not return NaN\n" );
111+
break;
112+
}
113+
}
114+
elapsed = tic() - t;
115+
if ( y != y ) {
116+
printf( "should not return NaN\n" );
117+
}
118+
return elapsed;
119119
}
120120

121121
/**
122122
* Main execution sequence.
123123
*/
124124
int main( void ) {
125-
double elapsed;
126-
int i;
125+
double elapsed;
126+
int i;
127127

128-
// Use the current time to seed the random number generator:
129-
srand( time( NULL ) );
128+
// Use the current time to seed the random number generator:
129+
srand( time( NULL ) );
130130

131-
print_version();
132-
for ( i = 0; i < REPEATS; i++ ) {
133-
printf( "# c::%s\n", NAME );
134-
elapsed = benchmark();
135-
print_results( elapsed );
136-
printf( "ok %d benchmark finished\n", i+1 );
137-
}
138-
print_summary( REPEATS, REPEATS );
131+
print_version();
132+
for ( i = 0; i < REPEATS; i++ ) {
133+
printf( "# c::%s\n", NAME );
134+
elapsed = benchmark();
135+
print_results( elapsed );
136+
printf( "ok %d benchmark finished\n", i + 1 );
137+
}
138+
print_summary( REPEATS, REPEATS );
139139
}

0 commit comments

Comments
 (0)