@stdlib/ndarray-base-assert-is-integer-data-type
v0.2.2
Published
Test if an input value is a supported ndarray integer data type.
Downloads
20
Readme
isIntegerDataType
Test if an input value is a supported ndarray integer data type.
Installation
npm install @stdlib/ndarray-base-assert-is-integer-data-type
Usage
var isIntegerDataType = require( '@stdlib/ndarray-base-assert-is-integer-data-type' );
isIntegerDataType( value )
Tests if an input value
is a supported ndarray integer (i.e., signed or unsigned integer) data type.
var bool = isIntegerDataType( 'float32' );
// returns false
bool = isIntegerDataType( 'uint32' );
// returns true
Examples
var isIntegerDataType = require( '@stdlib/ndarray-base-assert-is-integer-data-type' );
var bool = isIntegerDataType( 'binary' );
// returns false
bool = isIntegerDataType( 'float32' );
// returns false
bool = isIntegerDataType( 'float64' );
// returns false
bool = isIntegerDataType( 'generic' );
// returns false
bool = isIntegerDataType( 'int16' );
// returns true
bool = isIntegerDataType( 'int32' );
// returns true
bool = isIntegerDataType( 'int8' );
// returns true
bool = isIntegerDataType( 'uint16' );
// returns true
bool = isIntegerDataType( 'uint32' );
// returns true
bool = isIntegerDataType( 'uint8' );
// returns true
bool = isIntegerDataType( 'uint8c' );
// returns true
bool = isIntegerDataType( '' );
// returns false
bool = isIntegerDataType( 'foo' );
// 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.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.