Skip to content

Commit 149ce3c

Browse files
fixed lint errors
1 parent 5ea8205 commit 149ce3c

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,12 @@ double out = stdlib_base_dists_bernoulli_entropy( 0.1 );
167167

168168
The function accepts the following arguments:
169169

170-
- **x**: `[in] double` minimum support
171-
- **a**: `[in] double` minimum support
172-
- **b**: `[in] double` maximum support
170+
- **p**: `[in] double` maximum support
173171

174172
```c
175173
double stdlib_base_dists_bernoulli_entropy( const double p );
176174
```
175+
177176
</section>
178177
179178
<!-- /.usage -->
@@ -200,11 +199,11 @@ int main( void ) {
200199
double p;
201200
double y;
202201
int i;
203-
202+
204203
for ( i = 0; i < 25; i++ ) {
205-
p = ( (double)rand() / (double)RAND_MAX ) ;
206-
y = stdlib_base_dists_bernoulli_entropy( p );
207-
printf( "x: %lf , H(X;p): %lf\n", p , y );
204+
p = ( (double)rand() / (double)RAND_MAX );
205+
y = stdlib_base_dists_bernoulli_entropy( p );
206+
printf( "x: %lf, H(X;p): %lf\n", p, y );
208207
}
209208
}
210209
```

lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/benchmark/c/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ run: $(c_targets)
143143
clean:
144144
$(QUIET) -rm -f *.o *.out
145145

146-
.PHONY: clean
146+
.PHONY: clean

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include <sys/time.h>
1920
#include "stdlib/stats/base/dists/bernoulli/entropy.h"
20-
#include <stdlib.h>
21-
#include <stdio.h>
2221
#include <math.h>
22+
#include <stdio.h>
23+
#include <stdlib.h>
2324
#include <time.h>
24-
#include <sys/time.h>
2525

2626
#define NAME "bernoulli-entropy"
2727
#define ITERATIONS 1000000
@@ -71,7 +71,7 @@ static void print_results( double elapsed ) {
7171
static double tic( void ) {
7272
struct timeval now;
7373
gettimeofday( &now, NULL );
74-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
74+
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
7575
}
7676

7777
/**
@@ -98,7 +98,7 @@ static double benchmark( void ) {
9898

9999
t = tic();
100100
for ( i = 0; i < ITERATIONS; i++ ) {
101-
p = ( (double)rand() / (double)RAND_MAX ) ;
101+
p = ( (double)rand() / (double)RAND_MAX );
102102
y = stdlib_base_dists_bernoulli_entropy( p );
103103
if ( y != y ) {
104104
printf( "should not return NaN\n" );
@@ -119,15 +119,15 @@ int main( void ) {
119119
double elapsed;
120120
int i;
121121

122-
// Use the current time to seed the random number generator:
122+
// Use the current time to seed the random number generator:
123123
srand( time( NULL ) );
124124

125125
print_version();
126126
for ( i = 0; i < REPEATS; i++ ) {
127127
printf( "# c::%s\n", NAME );
128128
elapsed = benchmark();
129129
print_results( elapsed );
130-
printf( "ok %d benchmark finished\n", i+1 );
130+
printf( "ok %d benchmark finished\n", i + 1 );
131131
}
132132
print_summary( REPEATS, REPEATS );
133-
}
133+
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@
167167
], # end actions
168168
}, # end target copy_addon
169169
], # end targets
170-
}
170+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* @example
3030
* double y = stdlib_base_dists_bernoulli_entropy( 0.1 );
3131
* // returns ~0.325
32+
*
3233
* @example
3334
* double y = stdlib_base_dists_bernoulli_entropy( 0.5 );
3435
* // returns ~0.693

lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/test/test.native.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ var opts = {
4545

4646
// TESTS //
4747

48-
tape( 'main export is a function', function test( t ) {
48+
tape( 'main export is a function', opts, function test( t ) {
4949
t.ok( true, __filename );
5050
t.strictEqual( typeof entropy, 'function', 'main export is a function' );
5151
t.end();
5252
});
5353

54-
tape( 'if provided `NaN` for `p`, the function returns `NaN`', function test( t ) {
54+
tape( 'if provided `NaN` for `p`, the function returns `NaN`', opts, function test( t ) {
5555
var v = entropy( NaN );
5656
t.equal( isnan( v ), true, 'returns NaN' );
5757
t.end();
5858
});
5959

60-
tape( 'if provided `0` or `1` for `p`, the function returns `0`', function test( t ) {
60+
tape( 'if provided `0` or `1` for `p`, the function returns `0`', opts, function test( t ) {
6161
var v = entropy( 0.0 );
6262
t.strictEqual( v, 0.0, 'returns 0' );
6363

@@ -67,7 +67,7 @@ tape( 'if provided `0` or `1` for `p`, the function returns `0`', function test(
6767
t.end();
6868
});
6969

70-
tape( 'if provided a success probability `p` outside of `[0,1]`, the function returns `NaN`', function test( t ) {
70+
tape( 'if provided a success probability `p` outside of `[0,1]`, the function returns `NaN`', opts, function test( t ) {
7171
var v;
7272

7373
v = entropy( -1.0 );
@@ -85,7 +85,7 @@ tape( 'if provided a success probability `p` outside of `[0,1]`, the function re
8585
t.end();
8686
});
8787

88-
tape( 'the function returns the entropy of a Bernoulli distribution', function test( t ) {
88+
tape( 'the function returns the entropy of a Bernoulli distribution', opts, function test( t ) {
8989
var expected;
9090
var delta;
9191
var tol;

0 commit comments

Comments
 (0)