JSPM

@stdlib/assert-is-nonpositive-number

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q58856F
  • License Apache-2.0

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

Package Exports

  • @stdlib/assert-is-nonpositive-number

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/assert-is-nonpositive-number) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isNonPositiveNumber

NPM version Build Status Coverage Status dependencies

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

Installation

npm install @stdlib/assert-is-nonpositive-number

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

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.


License

See LICENSE.

Copyright © 2016-2021. The Stdlib Authors.