'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 float64ToInt32 = require( '@stdlib/math/base/utils/float64-to-int32' );
var pkg = require( './../package.json' ).name;
var int32ToUint32 = require( './../lib' );


// MAIN //

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

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		x = ( randu()*1.0e7 ) - 5.0e6;
		y = int32ToUint32( float64ToInt32( x ) );
		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();
});

@@ -116,24 +116,82 @@
 m/randu' );%0A
+var round = require( '@stdlib/math/base/special/round' );%0A
 var isnan = 
@@ -534,18 +534,24 @@
 %7B%0A%09%09x = 
+round
 ( 
+(
 randu()*
@@ -555,17 +555,16 @@
 ()*1.0e7
- 
 ) - 5.0e
@@ -564,16 +564,18 @@
  - 5.0e6
+ )
 ;%0A%09%09y = 

Update benchmark