time-to-botec/js/node_modules/@stdlib/assert/is-finite-array
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

isFiniteArray

Test if a value is an array-like object containing only finite numbers.

Usage

var isFiniteArray = require( '@stdlib/assert/is-finite-array' );

isFiniteArray( value )

Tests if a value is an array-like object containing only finite numbers.

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

var bool = isFiniteArray( [ -3.0, new Number(3.0) ] );
// returns true

bool = isFiniteArray( [ -3.0, 'abc' ] );
// returns false

bool = isFiniteArray( [ -3.0, 1.0/0.0 ] );
// returns false

isFiniteArray.primitives( value )

Tests if a value is an array-like object containing only primitive finite numbers.

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

var bool = isFiniteArray.primitives( [ -1.0, 0.0, 4.5 ] );
// returns true

bool = isFiniteArray.primitives( [ -1.0, 1.0/0.0 ] );
// returns false

bool = isFiniteArray.primitives( [ -3.0, new Number(2.0) ] );
// returns false

isFiniteArray.objects( value )

Tests if a value is an array-like object containing only Number objects having finite values.

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

var bool = isFiniteArray.objects( [ new Number(-1.0), new Number(2.0) ] );
// returns true

bool = isFiniteArray.objects( [ -1.0, 0.0, 1.0 ] );
// returns false

bool = isFiniteArray.objects( [ -3.0, new Number(1.0) ] );
// returns false

Examples

var Number = require( '@stdlib/number/ctor' );
var isFiniteArray = require( '@stdlib/assert/is-finite-array' );

var bool = isFiniteArray( [ -5.0, 0.0, 2.0, 5.0 ] );
// returns true

bool = isFiniteArray( [ -4.0, -3.14, 1.0, 3.14 ] );
// returns true

bool = isFiniteArray( [ -1.0, new Number( -6.0 ), 2.0 ] );
// returns true

bool = isFiniteArray( [ -1.0, 'abc', 3.0 ] );
// returns false

bool = isFiniteArray( [ -2.3, 1.0/0.0, 3.0 ] );
// returns false

bool = isFiniteArray( [] );
// returns false