About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, wellwritten, studied, documented, tested, measured, and highquality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Assert
Base math assertion utilities.
Installation
npm install @stdlib/mathbaseassert
Usage
var ns = require( '@stdlib/mathbaseassert' );
ns
Namespace containing "base" (i.e., lowerlevel) math assertion utilities.
var o = ns;
// returns {...}

isEvenInt32( x )
: test if a 32bit integer is even. 
isOddInt32( x )
: test if a 32bit integer is odd. 
isComposite( x )
: test if a number is a composite. 
isCoprime( a, b )
: test if two numbers are coprime. 
isEven( x )
: test if a finite numeric value is an even number. 
isFinite( x )
: test if a doubleprecision floatingpoint numeric value is finite. 
isFinitef( x )
: test if a singleprecision floatingpoint numeric value is finite. 
isInfinite( x )
: test if a doubleprecision floatingpoint numeric value is infinite. 
isInfinitef( x )
: test if a singleprecision floatingpoint numeric value is infinite. 
isInteger( x )
: test if a finite doubleprecision floatingpoint number is an integer. 
isnan( x )
: test if a doubleprecision floatingpoint numeric value is NaN. 
isnanf( x )
: test if a singleprecision floatingpoint numeric value is NaN. 
isNegativeFinite( x )
: test if a doubleprecision floatingpoint numeric value is a negative finite number. 
isNegativeInteger( x )
: test if a finite doubleprecision floatingpoint number is a negative integer. 
isNegativeZero( x )
: test if a doubleprecision floatingpoint numeric value is negative zero. 
isNegativeZerof( x )
: test if a singleprecision floatingpoint numeric value is negative zero. 
isNonNegativeFinite( x )
: test if a numeric value is a nonnegative finite number. 
isNonNegativeInteger( x )
: test if a finite doubleprecision floatingpoint number is a nonnegative integer. 
isNonPositiveFinite( x )
: test if a numeric value is a nonpositive finite number. 
isNonPositiveInteger( x )
: test if a finite doubleprecision floatingpoint number is a nonpositive integer. 
isOdd( x )
: test if a finite numeric value is an odd number. 
isPositiveFinite( x )
: test if a doubleprecision floatingpoint numeric value is a positive finite number. 
isPositiveInteger( x )
: test if a finite doubleprecision floatingpoint number is a positive integer. 
isPositiveZero( x )
: test if a doubleprecision floatingpoint numeric value is positive zero. 
isPositiveZerof( x )
: test if a singleprecision floatingpoint numeric value is positive zero. 
isPrime( x )
: test if a number is a prime. 
isProbability( x )
: test if a doubleprecision floatingpoint number is a probability. 
isSafeInteger( x )
: test if a finite doubleprecision floatingpoint number is a safe integer. 
isPow2Uint32( x )
: test whether an unsigned integer is a power of 2.
Examples
var objectKeys = require( '@stdlib/utilskeys' );
var ns = require( '@stdlib/mathbaseassert' );
console.log( objectKeys( ns ) );
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
License
See LICENSE.
Copyright
Copyright © 20162023. The Stdlib Authors.