'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/math/base/random/randu' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var EPS = require( '@stdlib/math/constants/float64-eps' );
var pkg = require( './../package.json' ).name;
var mode = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
	var alpha;
	var beta;
	var y;
	var i;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		alpha = (randu() * 10.0) + EPS;
		beta = (randu() * 10.0) + EPS;
		y = mode( alpha, beta );
		if ( isnan( y ) ) {
			b.fail( 'should not return NaN' );
		}
	}
	b.toc();
	if ( isnan( y ) ) {
		b.fail( 'should not return NaN' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/math/base/random/randu' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var EPS = require( '@stdlib/math/constants/float64-eps' );
var pkg = require( './../package.json' ).name;
var mode = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
	var alpha;
	var beta;
	var y;
	var i;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		alpha = ( randu()*10.0 ) + EPS;
		beta = ( randu()*10.0 ) + EPS;
		y = mode( alpha, beta );
		if ( isnan( y ) ) {
			b.fail( 'should not return NaN' );
		}
	}
	b.toc();
	if ( isnan( y ) ) {
		b.fail( 'should not return NaN' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});

Use consistent spacing