Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 uniform = require( '@stdlib/random/base/uniform' );
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,11 +48,11 @@ bench( pkg+'::native', opts, function benchmark( b ) {
var i;

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

b.tic();
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