Skip to content

Commit bdb61cc

Browse files
committed
Auto-generated commit
1 parent 6a2f992 commit bdb61cc

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-05-18)
7+
## Unreleased (2025-05-21)
88

99
<section class="commits">
1010

1111
### Commits
1212

1313
<details>
1414

15+
- [`ce62b14`](https://github.com/stdlib-js/stdlib/commit/ce62b1490d4948a707f496b66ad03bb296a2468a) - **docs:** replace manual `for` loop in examples [(#7055)](https://github.com/stdlib-js/stdlib/pull/7055) _(by Harsh)_
1516
- [`367fdcd`](https://github.com/stdlib-js/stdlib/commit/367fdcd966fd9b6c883997b6f0deebbe84a63cbd) - **bench:** update random value generation [(#7026)](https://github.com/stdlib-js/stdlib/pull/7026) _(by Harsh)_
1617
- [`02b9077`](https://github.com/stdlib-js/stdlib/commit/02b907765ad6a6ebcc884f16f2128475ab866814) - **bench:** refactor random number generation in `stats/base/dists/chisquare` [(#4860)](https://github.com/stdlib-js/stdlib/pull/4860) _(by Karan Anand)_
1718

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Ryan Seal <splrk@users.noreply.github.com>
146146
Rylan Yang <137365285+rylany27@users.noreply.github.com>
147147
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
148148
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
149+
Sachin Raj <120590207+schnrj@users.noreply.github.com>
149150
Sahil Goyal <87982509+sahil20021008@users.noreply.github.com>
150151
Sai Avinash <120403424+nasarobot@users.noreply.github.com>
151152
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
@@ -170,6 +171,7 @@ Tanishq Ahuja <68651083+TheGEN1U5@users.noreply.github.com>
170171
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
171172
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
172173
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
174+
Uday Kakade <141299403+udaykakade25@users.noreply.github.com>
173175
Utkarsh <http://utkarsh11105@gmail.com>
174176
Utkarsh Raj <rajutkarsh2505@gmail.com>
175177
UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,18 @@ y = mycdf( 1.5 );
165165
<!-- eslint no-undef: "error" -->
166166

167167
```javascript
168-
var randu = require( '@stdlib/random-base-randu' );
169-
var round = require( '@stdlib/math-base-special-round' );
168+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
169+
var uniform = require( '@stdlib/random-array-uniform' );
170+
var logEachMap = require( '@stdlib/console-log-each-map' );
170171
var cdf = require( '@stdlib/stats-base-dists-chisquare-cdf' );
171172

172-
var k;
173-
var x;
174-
var y;
175-
var i;
176-
177-
for ( i = 0; i < 20; i++ ) {
178-
x = randu() * 10.0;
179-
k = round( randu()*5.0 );
180-
y = cdf( x, k );
181-
console.log( 'x: %d, k: %d, F(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) );
182-
}
173+
var opts = {
174+
'dtype': 'float64'
175+
};
176+
var x = uniform( 20, 0.0, 10.0, opts );
177+
var k = discreteUniform( 20, 0, 10, opts );
178+
179+
logEachMap( 'x: %0.4f, k: %0.4f, F(x;k): %0.4f', x, k, cdf );
183180
```
184181

185182
</section>

examples/index.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,15 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random-base-randu' );
22-
var round = require( '@stdlib/math-base-special-round' );
21+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
22+
var uniform = require( '@stdlib/random-array-uniform' );
23+
var logEachMap = require( '@stdlib/console-log-each-map' );
2324
var cdf = require( './../lib' );
2425

25-
var k;
26-
var x;
27-
var y;
28-
var i;
26+
var opts = {
27+
'dtype': 'float64'
28+
};
29+
var x = uniform( 20, 0.0, 10.0, opts );
30+
var k = discreteUniform( 20, 0, 10, opts );
2931

30-
for ( i = 0; i < 20; i++ ) {
31-
x = randu() * 10.0;
32-
k = round( randu() * 10.0 );
33-
y = cdf( x, k );
34-
console.log( 'x: %d, k: %d, F(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) );
35-
}
32+
logEachMap( 'x: %0.4f, k: %0.4f, F(x;k): %0.4f', x, k, cdf );

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@
4141
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
4242
},
4343
"devDependencies": {
44+
"@stdlib/console-log-each-map": "github:stdlib-js/console-log-each-map#main",
4445
"@stdlib/constants-float64-eps": "^0.2.2",
4546
"@stdlib/constants-float64-ninf": "^0.2.2",
4647
"@stdlib/constants-float64-pinf": "^0.2.2",
4748
"@stdlib/math-base-assert-is-nan": "^0.2.2",
4849
"@stdlib/math-base-special-abs": "^0.2.2",
49-
"@stdlib/math-base-special-round": "^0.3.0",
5050
"@stdlib/random-array-discrete-uniform": "^0.2.1",
5151
"@stdlib/random-array-uniform": "^0.2.1",
52-
"@stdlib/random-base-randu": "^0.2.1",
5352
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5453
"istanbul": "^0.4.1",
5554
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",

0 commit comments

Comments
 (0)