Skip to content

Commit 0348270

Browse files
committed
fix: update README and C example to use direct uniform generation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2ba0f7c commit 0348270

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/node_modules/@stdlib/stats/base/dists/levy/pdf/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ y = mypdf( 20.0 );
113113
<!-- eslint no-undef: "error" -->
114114

115115
```javascript
116-
var randu = require( '@stdlib/random/base/randu' );
116+
var uniform = require( '@stdlib/random/base/uniform' );
117117
var EPS = require( '@stdlib/constants/float64/eps' );
118118
var pdf = require( '@stdlib/stats/base/dists/levy/pdf' );
119119

@@ -124,9 +124,9 @@ var y;
124124
var i;
125125

126126
for ( i = 0; i < 10; i++ ) {
127-
mu = randu() * 10.0;
128-
x = ( randu()*10.0 ) + mu;
129-
c = ( randu()*10.0 ) + EPS;
127+
mu = uniform( 0.0, 10.0 );
128+
x = uniform( mu, mu + 10.0 );
129+
c = uniform( EPS, 10.0 + EPS );
130130
y = pdf( x, mu, c );
131131
console.log( 'x: %d, µ: %d, c: %d, f(x;µ,c): %d', x, mu, c, y );
132132
}
@@ -219,8 +219,8 @@ int main( void ) {
219219
220220
for ( i = 0; i < 25; i++ ) {
221221
mu = random_uniform( 0.0, 10.0 );
222-
x = random_uniform( 0.0, 10.0 ) + mu;
223-
c = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
222+
x = random_uniform( mu, mu + 10.0 );
223+
c = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 + STDLIB_CONSTANT_FLOAT64_EPS );
224224
y = stdlib_base_dists_levy_pdf( x, mu, c );
225225
printf( "x: %lf, mu: %lf, c: %lf, f(x;mu,c): %lf\n", x, mu, c, y );
226226
}

lib/node_modules/@stdlib/stats/base/dists/levy/pdf/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ int main( void ) {
3535

3636
for ( i = 0; i < 25; i++ ) {
3737
mu = random_uniform( 0.0, 10.0 );
38-
x = random_uniform( 0.0, 10.0 ) + mu;
39-
c = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
38+
x = random_uniform( mu, mu + 10.0 );
39+
c = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 + STDLIB_CONSTANT_FLOAT64_EPS );
4040
y = stdlib_base_dists_levy_pdf( x, mu, c );
4141
printf( "x: %lf, mu: %lf, c: %lf, f(x;mu,c): %lf\n", x, mu, c, y );
4242
}

0 commit comments

Comments
 (0)