0.2.2 • Published 4 months ago

@stdlib/assert-is-positive-integer v0.2.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

isPositiveInteger

NPM version Build Status Coverage Status

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

Installation

npm install @stdlib/assert-is-positive-integer

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

See Also


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.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

@infinitebrahmanuniverse/nolb-_stdlib_a@everything-registry/sub-chunk-867@stdlib/bench-harness@stdlib/utils-merge@stdlib/utils-some@stdlib/utils-some-by@stdlib/utils-some-by-right@stdlib/utils-some-in-by@stdlib/utils-some-own-by@stdlib/utils-timeit@stdlib/utils-parallel@stdlib/utils-inherited-nonenumerable-property-symbols@stdlib/utils-inherited-properties@stdlib/utils-inherited-property-descriptor@stdlib/utils-inherited-property-descriptors@stdlib/utils-inherited-property-names@stdlib/utils-inherited-property-symbols@stdlib/utils-inherited-writable-properties@stdlib/utils-inherited-writable-property-names@stdlib/utils-inherited-writable-property-symbols@stdlib/datasets-sotu@stdlib/stats-base-dists-binomial-ctor@stdlib/stats-kstest@stdlib/stats-levene-test@stdlib/stats-pcorrtest@stdlib/stats-ttest@stdlib/stats-ttest2@stdlib/stats-vartest@stdlib/stats-wilcoxon@stdlib/stats-ztest@stdlib/stats-ztest2@stdlib/strided-dispatch@stdlib/strided-dispatch-by@stdlib/stats-iter-mrange@stdlib/stats-iter-msum@stdlib/stats-iter-msumabs@stdlib/stats-iter-msumabs2@stdlib/stats-kde2d@stdlib/stats-kruskal-test@stdlib/stats-iter-mmax@stdlib/stats-iter-mmaxabs@stdlib/stats-iter-mmean@stdlib/stats-iter-mmeanabs@stdlib/stats-iter-mmeanabs2@stdlib/stats-iter-mmidrange@stdlib/stats-iter-mmin@stdlib/stats-iter-mminabs@stdlib/stats-iter-mprod@stdlib/ndarray-dispatch@stdlib/ndarray-dispatch-by@stdlib/stats-binomial-test@stdlib/stats-chi2gof@stdlib/stats-chi2test@stdlib/stats-fligner-test@stdlib/repl-presentation@stdlib/simulate-iter-bartlett-hann-pulse@stdlib/simulate-iter-bartlett-pulse@stdlib/simulate-iter-cosine-wave@stdlib/simulate-iter-dirac-comb@stdlib/simulate-iter-flat-top-pulse@stdlib/simulate-iter-hann-pulse@stdlib/simulate-iter-lanczos-pulse@stdlib/simulate-iter-periodic-sinc@stdlib/simulate-iter-pulse@stdlib/simulate-iter-sawtooth-wave@stdlib/simulate-iter-sine-wave@stdlib/simulate-iter-square-wave@stdlib/simulate-iter-triangle-wave@stdlib/stats-anova1@stdlib/stats-bartlett-test@stdlib/stats-incr-covmat@stdlib/stats-incr-grubbs@stdlib/stats-incr-mgmean@stdlib/stats-incr-mgrubbs@stdlib/stats-incr-mhmean@stdlib/stats-incr-mmaape@stdlib/stats-incr-mmae@stdlib/stats-incr-mmape@stdlib/stats-incr-mmax@stdlib/stats-incr-pcorrdistmat@stdlib/stats-incr-pcorrmat@stdlib/stats-incr-mstdev@stdlib/stats-incr-msum@stdlib/stats-incr-msumabs@stdlib/stats-incr-msumabs2@stdlib/stats-incr-msummary@stdlib/stats-incr-msumprod@stdlib/stats-incr-mvariance@stdlib/stats-incr-mvmr@stdlib/stats-incr-mminmaxabs@stdlib/stats-incr-mmpe@stdlib/stats-incr-mmse@stdlib/stats-incr-mpcorr@stdlib/stats-incr-mpcorr2@stdlib/stats-incr-mpcorrdist@stdlib/stats-incr-mprod@stdlib/stats-incr-mrange@stdlib/stats-incr-mrmse@stdlib/stats-incr-mrss@stdlib/stats-incr-mapcorr
0.2.2

4 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.0

1 year ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago