Skip to content

Commit 04d772f

Browse files
chore: stuff from code review
1 parent 03568bc commit 04d772f

File tree

6 files changed

+7
-13
lines changed

6 files changed

+7
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Evaluates the probability mass function (PMF) for a Bernoulli distribution with
165165

166166
```c
167167
double y = stdlib_base_dists_bernoulli_pmf( 0.5, 0.5 );
168-
// returns ~0.5
168+
// returns 0.5
169169
```
170170

171171
The function accepts the following arguments:
@@ -216,7 +216,7 @@ int main( void ) {
216216
x = stdlib_base_round( random_uniform( 0.0, 2.0 ) );
217217
p = random_uniform( 0.0, 1.0 );
218218
y = stdlib_base_dists_bernoulli_pmf( x, p );
219-
printf( "x: %lf , p: %1f, P( X = x; p ): %lf\n", x, p, y );
219+
printf( "x: %lf. p: %1f. P( X = x; p ): %lf\n", x, p, y );
220220
}
221221
}
222222
```

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ bench( pkg, function benchmark( b ) {
4040

4141
len = 100;
4242
x = new Float64Array( len );
43-
for ( i = 0; i < len; i++ ) {
44-
x[ i ] = round( uniform( 0.0, 3.0 ) );
45-
}
4643
p = new Float64Array( len );
4744
for ( i = 0; i < len; i++ ) {
45+
x[ i ] = round( uniform( 0.0, 3.0 ) );
4846
p[ i ] = uniform( 0.0, 1.0 );
4947
}
5048

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4949

5050
len = 100;
5151
x = new Float64Array( len );
52-
for ( i = 0; i < len; i++ ) {
53-
x[ i ] = round( uniform( 0.0, 3.0 ) );
54-
}
5552
p = new Float64Array( len );
5653
for ( i = 0; i < len; i++ ) {
54+
x[ i ] = round( uniform( 0.0, 3.0 ) );
5755
p[ i ] = uniform( 0.0, 1.0 );
5856
}
5957

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ static double benchmark( void ) {
102102

103103
for ( i = 0; i < 100; i++ ) {
104104
x[ i ] = stdlib_base_round( random_uniform( 0.0, 3.0 ) );
105-
}
106-
for ( i = 0; i < 100; i++ ) {
107105
p[ i ] = random_uniform( 0.0, 1.0 );
108106
}
109107

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ int main( void ) {
3636
x = stdlib_base_round( random_uniform( 0.0, 2.0 ) );
3737
p = random_uniform( 0.0, 1.0 );
3838
y = stdlib_base_dists_bernoulli_pmf( x, p );
39-
printf( "x: %lf , p: %1f, P( X = x; p ): %lf\n", x, p, y );
39+
printf( "x: %lf. p: %1f. P( X = x; p ): %lf\n", x, p, y );
4040
}
4141
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
*
2525
* @param x input value
2626
* @param p success probability
27-
* @returns evaluated PMF
27+
* @return evaluated PMF
2828
*
2929
* @example
3030
* double y = stdlib_base_dists_bernoulli_pmf( 0.5, 0.5 );
31-
* // returns ~0.5
31+
* // returns 0.5
3232
*/
3333
double stdlib_base_dists_bernoulli_pmf( const double x, const double p ) {
3434
if (

0 commit comments

Comments
 (0)