isSignedIntegerDataType

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

Usage

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

isSignedIntegerDataType( value )

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

var bool = isSignedIntegerDataType( 'float32' );
// returns false

bool = isSignedIntegerDataType( 'int32' );
// returns true

Examples

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

var bool = isSignedIntegerDataType( 'float32' );
// returns false

bool = isSignedIntegerDataType( 'float64' );
// returns false

bool = isSignedIntegerDataType( 'generic' );
// returns false

bool = isSignedIntegerDataType( 'int16' );
// returns true

bool = isSignedIntegerDataType( 'int32' );
// returns true

bool = isSignedIntegerDataType( 'int8' );
// returns true

bool = isSignedIntegerDataType( 'uint16' );
// returns false

bool = isSignedIntegerDataType( 'uint32' );
// returns false

bool = isSignedIntegerDataType( 'uint8' );
// returns false

bool = isSignedIntegerDataType( 'uint8c' );
// returns false

bool = isSignedIntegerDataType( '' );
// returns false

bool = isSignedIntegerDataType( 'foo' );
// returns false
Did you find this page helpful?