Skip to content

Commit b7867cb

Browse files
committed
chore: minor 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: 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: passed - 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: passed - 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 --- --- 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: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests 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: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent d3d3d14 commit b7867cb

File tree

23 files changed

+64
-66
lines changed

23 files changed

+64
-66
lines changed

lib/node_modules/@stdlib/math/base/special/boxcox1pinv/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @return inverse of the Box-Cox transformation
3131
*
3232
* @example
33-
* var v = boxcox1pinv( 1.0, 2.5 );
33+
* double v = boxcox1pinv( 1.0, 2.5 );
3434
* // returns ~0.6505
3535
*/
3636
double stdlib_base_boxcox1pinv( const double y, const double lambda ) {

lib/node_modules/@stdlib/math/base/special/boxcoxinv/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @return inverse of the Box-Cox transformation
3030
*
3131
* @example
32-
* var v = boxcoxinv( 1.0, 2.5 );
32+
* double v = boxcoxinv( 1.0, 2.5 );
3333
* // returns ~1.6505
3434
*/
3535
double stdlib_base_boxcoxinv( const double y, const double lambda ) {

lib/node_modules/@stdlib/math/base/special/csch/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
* @return hyperbolic cosecant
2727
*
2828
* @example
29-
* var v = stdlib_base_csch( 2.0 );
29+
* double v = stdlib_base_csch( 2.0 );
3030
* // returns ~0.2757
3131
*
3232
* @example
33-
* var v = stdlib_base_csch( -2.0 );
33+
* double v = stdlib_base_csch( -2.0 );
3434
* // returns ~-0.2757
3535
*/
3636
double stdlib_base_csch( const double x ) {

lib/node_modules/@stdlib/math/base/special/gammasgn/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @return sign of the gamma function
2828
*
2929
* @example
30-
* var v = gammasgn( 1.0 );
30+
* double v = gammasgn( 1.0 );
3131
* // returns 1.0
3232
*/
3333
double stdlib_base_gammasgn( const double x ) {

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mean/benchmark/c/benchmark.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ static double tic( void ) {
7575
}
7676

7777
/**
78-
* Generates a random number on the interval [0,1).
78+
* Generates a random number on the interval [min,max).
7979
*
80-
* @return random number
80+
* @param min minimum value (inclusive)
81+
* @param max maximum value (exclusive)
82+
* @return random number
8183
*/
82-
static double rand_double( void ) {
83-
int r = rand();
84-
return (double)r / ( (double)RAND_MAX + 1.0 );
84+
static double random_uniform( const double min, const double max ) {
85+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
86+
return min + ( v*(max-min) );
8587
}
8688

8789
/**
@@ -97,7 +99,7 @@ static double benchmark( void ) {
9799
int i;
98100

99101
for ( i = 0; i < 100; i++ ) {
100-
p[ i ] = rand_double();
102+
p[ i ] = random_uniform( 0.0, 1.0 );
101103
}
102104

103105
t = tic();

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mode/benchmark/c/benchmark.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ static double tic( void ) {
7575
}
7676

7777
/**
78-
* Generates a random number on the interval [0,1).
78+
* Generates a random number on the interval [min,max).
7979
*
80-
* @return random number
80+
* @param min minimum value (inclusive)
81+
* @param max maximum value (exclusive)
82+
* @return random number
8183
*/
82-
static double rand_double( void ) {
83-
int r = rand();
84-
return (double)r / ( (double)RAND_MAX + 1.0 );
84+
static double random_uniform( const double min, const double max ) {
85+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
86+
return min + ( v*(max-min) );
8587
}
8688

8789
/**
@@ -97,7 +99,7 @@ static double benchmark( void ) {
9799
int i;
98100

99101
for ( i = 0; i < 100; i++ ) {
100-
p[ i ] = rand_double();
102+
p[ i ] = random_uniform( 0.0, 1.0 );
101103
}
102104

103105
t = tic();

lib/node_modules/@stdlib/stats/base/dists/exponential/mean/test/test.native.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
27-
var abs = require( '@stdlib/math/base/special/abs' );
2827
var NINF = require( '@stdlib/constants/float64/ninf' );
29-
var EPS = require( '@stdlib/constants/float64/eps' );
3028

3129

3230
// VARIABLES //
@@ -68,25 +66,17 @@ tape( 'if provided a rate parameter `lambda` that is not a nonnegative number, t
6866
t.end();
6967
});
7068

71-
tape( 'the function returns the mean of an exponential distribution', opts, function test( t ) {
69+
tape( 'the function returns the expected value of an exponential distribution', opts, function test( t ) {
7270
var expected;
7371
var lambda;
74-
var delta;
75-
var tol;
7672
var i;
7773
var y;
7874

7975
expected = data.expected;
8076
lambda = data.lambda;
8177
for ( i = 0; i < expected.length; i++ ) {
8278
y = mean( lambda[i] );
83-
if ( y === expected[ i ] ) {
84-
t.equal( y, expected[i], 'lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
85-
} else {
86-
delta = abs( y - expected[ i ] );
87-
tol = 2.0 * EPS * abs( expected[ i ] );
88-
t.ok( delta <= tol, 'within tolerance. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
89-
}
79+
t.equal( y, expected[i], 'lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
9080
}
9181
t.end();
9282
});

lib/node_modules/@stdlib/stats/base/dists/f/skewness/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static double benchmark( void ) {
102102

103103
for ( i = 0; i < 100; i++ ) {
104104
d1[ i ] = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
105-
d2[ i ] = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
105+
d2[ i ] = random_uniform( 0.0, 10.0 ) + 6.0 + STDLIB_CONSTANT_FLOAT64_EPS;
106106
}
107107

108108
t = tic();

lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ for ( i = 0; i < 10; i++ ) {
170170

171171
#### stdlib_base_dists_gamma_kurtosis( alpha, beta )
172172

173-
Returns the kurtosis of a gamma distribution.
173+
Returns the [excess kurtosis][kurtosis] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).
174174

175175
```c
176176
double out = stdlib_base_dists_gamma_kurtosis( 1.0, 1.0 );

lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @example
3030
* double y = stdlib_base_gamma_kurtosis( 1.0, 1.0 );
31-
* // returns 1.0
31+
* // returns 6.0
3232
*/
3333
double stdlib_base_dists_gamma_kurtosis( const double alpha, const double beta ) {
3434
if (

0 commit comments

Comments
 (0)