# isNonNegativeInteger > Test if a finite [double-precision floating-point number][ieee754] is a nonnegative integer.
## Usage ```javascript var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); ``` #### isNonNegativeInteger( x ) Tests if a finite [double-precision floating-point number][ieee754] is a nonnegative `integer`. ```javascript var bool = isNonNegativeInteger( 1.0 ); // returns true bool = isNonNegativeInteger( 0.0 ); // returns true bool = isNonNegativeInteger( -10.0 ); // returns false ```
## Notes - The function assumes a **finite** `number`. If provided positive `infinity`, the function will return `true`, when, in fact, the result is undefined. If `x` can be `infinite`, wrap the implementation as follows: ```javascript function check( x ) { return ( x < Infinity && isNonNegativeInteger( x ) ); } var bool = check( Infinity ); // returns false ``` - The function does **not** distinguish between positive and negative `zero`. ```javascript var bool = isNonNegativeInteger( 0.0 ); // returns true bool = isNonNegativeInteger( -0.0 ); // returns true ```
## Examples ```javascript var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); var bool = isNonNegativeInteger( 5.0 ); // returns true bool = isNonNegativeInteger( 0.0 ); // returns true bool = isNonNegativeInteger( -1.0 ); // returns false bool = isNonNegativeInteger( 3.14 ); // returns false bool = isNonNegativeInteger( NaN ); // returns false ```