'use strict';

var randu = require( '@stdlib/math/base/random/randu' );
var round = require( '@stdlib/math/base/special/round' );
var mean = require( './../lib' );

var v;
var i;
var n;
var p;

for ( i = 0; i < 10; i++ ) {
	n = round( randu() * 100 );
	p = randu();
	v = mean( n, p );
	console.log( 'n: %d, p: %d, E(X;n,p): %d',
		n,
		p.toFixed( 4 ),
		v.toFixed( 4 )
	);
}


'use strict';

var randu = require( '@stdlib/math/base/random/randu' );
var round = require( '@stdlib/math/base/special/round' );
var mean = require( './../lib' );

var v;
var i;
var n;
var p;

for ( i = 0; i < 10; i++ ) {
	n = round( randu() * 100.0 );
	p = randu();
	v = mean( n, p );
	console.log( 'n: %d, p: %d, E(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) );
}


Add decimal