Skip to content

Commit 4a955a9

Browse files
committed
chore: clean-up
--- 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: na - 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: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - 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 ---
1 parent ad7be7a commit 4a955a9

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

lib/node_modules/@stdlib/stats/base/dists/bradford/stdev/benchmark/c/benchmark.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,9 @@ static double benchmark( void ) {
9999
double y;
100100
int i;
101101

102-
// Generate test data:
103102
for ( i = 0; i < 100; i++ ) {
104103
c[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
105104
}
106-
107-
// Run the benchmark:
108105
t = tic();
109106
for ( i = 0; i < ITERATIONS; i++ ) {
110107
y = stdlib_base_dists_bradford_stdev( c[ i % 100 ] );
@@ -125,21 +122,17 @@ static double benchmark( void ) {
125122
*/
126123
int main( void ) {
127124
double elapsed;
128-
int count;
129125
int i;
130126

131127
// Use the current time to seed the pseudorandom number generator:
132128
srand( time( NULL ) );
133129

134130
print_version();
135-
count = 0;
136131
for ( i = 0; i < REPEATS; i++ ) {
137-
count += 1;
138132
printf( "# c::%s\n", NAME );
139133
elapsed = benchmark();
140-
printf( "ok %d benchmark finished\n", count );
141134
print_results( elapsed );
142-
printf( "\n" );
135+
printf( "ok %d benchmark finished\n", i+1 );
143136
}
144-
print_summary( count, count );
137+
print_summary( REPEATS, REPEATS );
145138
}

lib/node_modules/@stdlib/stats/base/dists/bradford/stdev/lib/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
5959
*/
6060
function stdev( c ) {
6161
var k;
62-
if (
63-
isnan( c ) ||
64-
c <= 0.0
65-
) {
62+
if ( isnan( c ) || c <= 0.0 ) {
6663
return NaN;
6764
}
6865
k = ln( 1.0 + c );

lib/node_modules/@stdlib/stats/base/dists/bradford/stdev/lib/native.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ var addon = require( './../src/addon.node' );
5656
* var v = stdev( NaN );
5757
* // returns NaN
5858
*/
59-
var stdev = addon;
59+
function stdev( c ) {
60+
return addon( c );
61+
}
6062

6163

6264
// EXPORTS //

lib/node_modules/@stdlib/stats/base/dists/bradford/stdev/src/main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@
3333
*/
3434
double stdlib_base_dists_bradford_stdev( const double c ) {
3535
double k;
36-
if (
37-
stdlib_base_is_nan( c ) ||
38-
c <= 0.0
39-
) {
36+
if ( stdlib_base_is_nan( c ) || c <= 0.0 ) {
4037
return 0.0/0.0; // NaN
4138
}
4239
k = stdlib_base_ln( 1.0 + c );
43-
return stdlib_base_sqrt( ( ( ( 2.0 + c ) * k ) - ( 2.0 * c ) ) / ( 2.0 * c * k * k ) );
40+
return stdlib_base_sqrt( ( ( ( 2.0+c ) * k ) - ( 2.0*c ) ) / ( 2.0*c*k*k ) );
4441
}

0 commit comments

Comments
 (0)