Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: address commit comments and use discrete uniform PRNG #5313

Merged
merged 10 commits into from
Feb 22, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Returns the [median][median] of a [binomial][binomial-distribution] distribution

```c
double out = stdlib_base_dists_binomial_median( 100, 0.1 );
// returns 10
// returns 10.0
```

The function accepts the following arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var Int32Array = require( '@stdlib/array/int32' );
var Float64Array = require( '@stdlib/array/float64' );
var tryRequire = require( '@stdlib/utils/try-require' );
var ceil = require( '@stdlib/math/base/special/ceil' );
var randu = require( '@stdlib/random/base/randu' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;

Expand All @@ -49,10 +48,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
var i;

len = 100;
n = new Int32Array( len );
n = discreteUniform( len, 1, 100 );
p = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
n[ i ] = ceil( randu() * 100.0 );
p[ i ] = randu();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @example
* double y = stdlib_base_dists_binomial_median( 100, 0.1 );
* // returns 10
* // returns 10.0
*/
double stdlib_base_dists_binomial_median( const int32_t n, const double p ) {
if (
Expand Down
Loading