Skip to content

Commit e330cf0

Browse files
chore: stuff from code review
1 parent 4b32e1f commit e330cf0

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Evaluates the moment-generating function (MGF) for a Bernoulli distribution with
172172

173173
```c
174174
double y = stdlib_base_dists_bernoulli_mgf( 0.2, 0.5 );
175-
// returns ~1.111
175+
// returns 1.111
176176
```
177177

178178
The function accepts the following arguments:
@@ -222,7 +222,7 @@ int main( void ) {
222222
t = random_uniform( -2.0, 2.0 );
223223
p = random_uniform( 0.0, 1.0 );
224224
y = stdlib_base_dists_bernoulli_mgf( t, p );
225-
printf( "t: %lf , p: %1f, M_X(t;p): %lf\n", t, p , y );
225+
printf( "t: %lf. p: %1f. M_X(t;p): %lf\n", t, p , y );
226226
}
227227
}
228228
```

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/benchmark.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ bench( pkg, function benchmark( b ) {
3838
var i;
3939

4040
len = 100;
41-
p = new Float64Array( len );
42-
for ( i = 0; i < len; i++ ) {
43-
p[ i ] = uniform( 0.0, 1.0 );
44-
}
4541
t = new Float64Array( len );
42+
p = new Float64Array( len );
4643
for ( i = 0; i < len; i++ ) {
4744
t[ i ] = uniform( 0.0, 3.0 );
45+
p[ i ] = uniform( 0.0, 1.0 );
4846
}
4947

5048
b.tic();

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/benchmark.native.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4747
var i;
4848

4949
len = 100;
50-
p = new Float64Array( len );
51-
for ( i = 0; i < len; i++ ) {
52-
p[ i ] = uniform( 0.0, 1.0 );
53-
}
50+
t = new Float64Array( len );
5451
p = new Float64Array( len );
5552
for ( i = 0; i < len; i++ ) {
5653
t[ i ] = uniform( 0.0, 3.0 );
54+
p[ i ] = uniform( 0.0, 1.0 );
5755
}
5856

5957
b.tic();

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ static double benchmark( void ) {
9999
double x;
100100
int i;
101101

102-
for ( i = 0; i < 100; i++ ) {
103-
p[ i ] = random_uniform( 0.0, 1.0 );
104-
}
105102
for ( i = 0; i < 100; i++ ) {
106103
t[ i ] = random_uniform( 0.0, 3.0 );
104+
p[ i ] = random_uniform( 0.0, 1.0 );
107105
}
108106

109107
x = tic();

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ int main( void ) {
3535
t = random_uniform( -2.0, 2.0 );
3636
p = random_uniform( 0.0, 1.0 );
3737
y = stdlib_base_dists_bernoulli_mgf( t, p );
38-
printf( "t: %lf , p: %1f, M_X(t;p): %lf\n", t, p , y );
38+
printf( "t: %lf. p: %1f. M_X(t;p): %lf\n", t, p , y );
3939
}
4040
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
*
2626
* @param t input value
2727
* @param p success probability
28-
* @returns evaluated MGF
28+
* @return evaluated MGF
2929
*
3030
* @example
3131
* double y = stdlib_base_dists_bernoulli_mgf( 0.2, 0.5 );
32-
* // returns ~1.111
32+
* // returns 1.111
3333
*/
3434
double stdlib_base_dists_bernoulli_mgf( const double t, const double p ) {
3535
if (

0 commit comments

Comments
 (0)