Skip to content

Commit 0bf6b8f

Browse files
authored
chore: apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent 48de464 commit 0bf6b8f

File tree

5 files changed

+12
-35
lines changed

5 files changed

+12
-35
lines changed

lib/node_modules/@stdlib/stats/base/dists/weibull/mode/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ int main( void ) {
216216
double y;
217217
int i;
218218
for ( i = 0; i < 25; i++ ) {
219-
k = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
220-
lambda = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
219+
k = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
220+
lambda = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
221221
y = stdlib_base_dists_weibull_mode( k, lambda );
222-
printf( "k: %lf, λ: %lf, E(X;k,λ): %lf\n", k, lambda, y );
222+
printf( "k: %lf, λ: %lf, mode(X;k,λ): %lf\n", k, lambda, y );
223223
}
224224
}
225225
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static double benchmark( void ) {
101101
int i;
102102

103103
for ( i = 0; i < 100; i++ ) {
104-
lambda[ i ] = random_uniform( 0.0, 1.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
105-
k[ i ] = random_uniform( 0.0, 1.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
104+
lambda[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 1.0 );
105+
k[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 1.0 );
106106
}
107107

108108
t = tic();

lib/node_modules/@stdlib/stats/base/dists/weibull/mode/examples/c/example.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ int main( void ) {
3333
int i;
3434

3535
for ( i = 0; i < 25; i++ ) {
36-
k = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
37-
lambda = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
36+
k = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
37+
lambda = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
3838
y = stdlib_base_dists_weibull_mode( k, lambda );
39-
printf( "k: %lf, λ: %lf, MODE(X;t,k,λ): %lf\n", k, lambda, y );
39+
printf( "k: %lf, λ: %lf, mode(X;k,λ): %lf\n", k, lambda, y );
4040
}
4141
}

lib/node_modules/@stdlib/stats/base/dists/weibull/mode/lib/native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' );
2828
/**
2929
* Returns the mode of a Weibull distribution.
3030
*
31+
* @private
3132
* @param {PositiveNumber} k - shape parameter
3233
* @param {PositiveNumber} lambda - scale parameter
3334
* @returns {NonNegativeNumber} mode

lib/node_modules/@stdlib/stats/base/dists/weibull/mode/src/main.c

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,13 @@
2626
/**
2727
* Returns the mode of a Weibull distribution.
2828
*
29-
* @param {PositiveNumber} k - shape parameter
30-
* @param {PositiveNumber} lambda - scale parameter
31-
* @returns {NonNegativeNumber} mode
29+
* @param k shape parameter
30+
* @param lambda scale parameter
31+
* @return mode
3232
*
3333
* @example
3434
* double v = stdlib_base_dists_weibull_mode( 1.0, 1.0 );
3535
* // returns 0.0
36-
*
37-
* @example
38-
* double v = stdlib_base_dists_weibull_mode( 4.0, 12.0 );
39-
* // returns ~11.167
40-
*
41-
* @example
42-
* double v = stdlib_base_dists_weibull_mode( 8.0, 2.0 );
43-
* // returns ~1.967
44-
*
45-
* @example
46-
* double v = stdlib_base_dists_weibull_mode( 1.0, -0.1 );
47-
* // returns NaN
48-
*
49-
* @example
50-
* double v = stdlib_base_dists_weibull_mode( -0.1, 1.0 );
51-
* // returns NaN
52-
*
53-
* @example
54-
* double v = stdlib_base_dists_weibull_mode( 2.0, NaN );
55-
* // returns NaN
56-
*
57-
* @example
58-
* double v = stdlib_base_dists_weibull_mode( NaN, 2.0 );
59-
* // returns NaN
6036
*/
6137
double stdlib_base_dists_weibull_mode( const double k, const double lambda ) {
6238
if (

0 commit comments

Comments
 (0)