time-to-botec/js/node_modules/@stdlib/assert/is-positive-integer
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isPositiveInteger

Test if a value is a number having a positive integer value.

Usage

var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );

isPositiveInteger( value )

Tests if a value is a number having a positive integer value.

var Number = require( '@stdlib/number/ctor' );

var bool = isPositiveInteger( 5.0 );
// returns true

bool = isPositiveInteger( new Number( 5.0 ) );
// returns true

bool = isPositiveInteger( -5.0 );
// returns false

bool = isPositiveInteger( 0.0 );
// returns false

bool = isPositiveInteger( 3.14 );
// returns false

bool = isPositiveInteger( null );
// returns false

isPositiveInteger.isPrimitive( value )

Tests if a value is a primitive number having a positive integer value.

var Number = require( '@stdlib/number/ctor' );

var bool = isPositiveInteger.isPrimitive( 3.0 );
// returns true

bool = isPositiveInteger.isPrimitive( new Number( 3.0 ) );
// returns false

isPositiveInteger.isObject( value )

Tests if a value is a Number object having a positive integer value.

var Number = require( '@stdlib/number/ctor' );

var bool = isPositiveInteger.isObject( 3.0 );
// returns false

bool = isPositiveInteger.isObject( new Number( 3.0 ) );
// returns true

Examples

var Number = require( '@stdlib/number/ctor' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );

var bool = isPositiveInteger( 5.0 );
// returns true

bool = isPositiveInteger( new Number( 5.0 ) );
// returns true

bool = isPositiveInteger( 0.0 );
// returns false

bool = isPositiveInteger( 3.14 );
// returns false

bool = isPositiveInteger( -5.0 );
// returns false

bool = isPositiveInteger( '5' );
// returns false

bool = isPositiveInteger( null );
// returns false