'use strict';

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

var i;
var n;
var p;
var x;
var y;

for ( i = 0; i < 10; i++ ) {
	x = round( randu() * 20 );
	n = round( randu() * 100 );
	p = randu();
	y = pmf( x, n, p );
	console.log( 'x: %d, n: %d, p: %d, P(X = x;n,p): %d',
		x,
		n,
		p.toFixed( 4 ),
		y.toFixed( 4 )
	);
}

@@ -246,16 +246,18 @@
 u() * 20
+.0
  );%0A%09n =
@@ -277,16 +277,18 @@
 () * 100
+.0
  );%0A%09p =
@@ -376,21 +376,15 @@
 %25d',
-%0A%09%09x,%0A%09%09n,%0A%09%09
+ x, n, 
 p.to
@@ -398,11 +398,9 @@
 4 ),
-%0A%09%09
+ 
 y.to
@@ -409,15 +409,14 @@
 xed( 4 )
-%0A%09
+ 
 );%0A%7D%0A

Add decimals