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

2.7 KiB

isNonPositiveNumber

Test if a value is a number having a nonpositive value.

Usage

var isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' );

isNonPositiveNumber( value )

Tests if a value is a number having a nonpositive value.

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

var bool = isNonPositiveNumber( -5.0 );
// returns true

bool = isNonPositiveNumber( new Number( -5.0 ) );
// returns true

bool = isNonPositiveNumber( -3.14 );
// returns true

bool = isNonPositiveNumber( 5.0 );
// returns false

bool = isNonPositiveNumber( null );
// returns false

isNonPositiveNumber.isPrimitive( value )

Tests if a value is a primitive number having a nonpositive value.

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

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

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

isNonPositiveNumber.isObject( value )

Tests if a value is a Number object having a nonpositive value.

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

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

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

Examples

var Number = require( '@stdlib/number/ctor' );
var isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' );

var bool = isNonPositiveNumber( -5.0 );
// returns true

bool = isNonPositiveNumber( new Number( -5.0 ) );
// returns true

bool = isNonPositiveNumber( 0.0 );
// returns true

bool = isNonPositiveNumber( -3.14 );
// returns true

bool = isNonPositiveNumber( 5.0 );
// returns false

bool = isNonPositiveNumber( '-5' );
// returns false

bool = isNonPositiveNumber( null );
// returns false