Skip to content

Commit e6796cd

Browse files
chore: stuff from code review
1 parent c80dab9 commit e6796cd

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Evaluates the cumulative distribution function (CDF) for a Bernoulli distributio
161161

162162
```c
163163
double y = stdlib_base_dists_bernoulli_cdf( 0.5, 0.5 );
164-
// returns ~0.5
164+
// returns 0.5
165165
```
166166

167167
The function accepts the following arguments
@@ -211,7 +211,7 @@ int main( void ) {
211211
x = random_uniform( 0.0, 5.0 );
212212
p = random_uniform( 0.0, 1.0 );
213213
y = stdlib_base_dists_bernoulli_cdf( x, p );
214-
printf( "x: %lf , p: %1f, F(X;p): %lf\n", x, p , y );
214+
printf( "x: %lf. p: %1f. F(X;p): %lf\n", x, p , y );
215215
}
216216
}
217217
```

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

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

4040
len = 100;
4141
x = new Float64Array( len );
42-
for ( i = 0; i < len; i++ ) {
43-
x[ i ] = uniform( -1.0, 2.0 );
44-
}
4542
p = new Float64Array( len );
4643
for ( i = 0; i < len; i++ ) {
44+
x[ i ] = uniform( -1.0, 2.0 );
4745
p[ i ] = uniform( 0.0, 1.0 );
4846
}
4947

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

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

4949
len = 100;
5050
x = new Float64Array( len );
51-
for ( i = 0; i < len; i++ ) {
52-
x[ i ] = uniform( -1.0, 2.0 );
53-
}
5451
p = new Float64Array( len );
5552
for ( i = 0; i < len; i++ ) {
53+
x[ i ] = uniform( -1.0, 2.0 );
5654
p[ i ] = uniform( 0.0, 1.0 );
5755
}
5856

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ static double benchmark( void ) {
101101

102102
for ( i = 0; i < 100; i++ ) {
103103
p[ i ] = random_uniform( 0.0, 1.0 );
104-
}
105-
for ( i = 0; i < 100; i++ ) {
106104
x[ i ] = random_uniform( -1.0, 2.0 );
107105
}
108106

109107
t = tic();
110108
for ( i = 0; i < ITERATIONS; i++ ) {
111-
y = stdlib_base_dists_bernoulli_cdf( x[ i%100 ], p[ i%100 ] );
109+
y = stdlib_base_dists_bernoulli_cdf( x[ i % 100 ], p[ i % 100 ] );
112110
if ( y != y ) {
113111
printf( "should not return NaN\n" );
114112
break;

lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/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
x = random_uniform( 0.0, 5.0 );
3636
p = random_uniform( 0.0, 1.0 );
3737
y = stdlib_base_dists_bernoulli_cdf( x, p );
38-
printf( "x: %lf , p: %1f, F(X;p): %lf\n", x, p , y );
38+
printf( "x: %lf. p: %1f. F(X;p): %lf\n", x, p , y );
3939
}
4040
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/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 CDF
27+
* @return evaluated CDF
2828
*
2929
* @example
3030
* double y = stdlib_base_dists_bernoulli_cdf( 0.5, 0.5 );
31-
* // returns ~0.5
31+
* // returns 0.5
3232
*/
3333
double stdlib_base_dists_bernoulli_cdf( const double x, const double p ) {
3434
if (

0 commit comments

Comments
 (0)