isIntegerDataType

Test if an input value is a supported array integer data type.

Usage

var isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type' );

isIntegerDataType( value )

Tests if an input value is a supported array 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/array/base/assert/is-integer-data-type' );

var 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
Did you find this page helpful?