isFloatingPointDataType

Test if an input value is a supported ndarray floating-point data type.

Usage

var isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' );

isFloatingPointDataType( value )

Tests if an input value is a supported ndarray floating-point data type.

var bool = isFloatingPointDataType( 'float32' );
// returns true

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

Examples

var isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' );

var bool = isFloatingPointDataType( 'binary' );
// returns false

bool = isFloatingPointDataType( 'float32' );
// returns true

bool = isFloatingPointDataType( 'float64' );
// returns true

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

bool = isFloatingPointDataType( 'int16' );
// returns false

bool = isFloatingPointDataType( 'int32' );
// returns false

bool = isFloatingPointDataType( 'int8' );
// returns false

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

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

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

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

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

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