0.2.1 • Published 2 months ago

@stdlib/ndarray-base-assert-is-real-data-type v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

isRealDataType

NPM version Build Status Coverage Status

Test if an input value is a supported ndarray real-valued data type.

Installation

npm install @stdlib/ndarray-base-assert-is-real-data-type

Usage

var isRealDataType = require( '@stdlib/ndarray-base-assert-is-real-data-type' );

isRealDataType( value )

Tests if an input value is a supported ndarray real-valued data type.

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

bool = isRealDataType( 'uint32' );
// returns true

Examples

var isRealDataType = require( '@stdlib/ndarray-base-assert-is-real-data-type' );

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

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

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

bool = isRealDataType( 'complex128' );
// returns false

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

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

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

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

bool = isRealDataType( 'uint16' );
// returns true

bool = isRealDataType( 'uint32' );
// returns true

bool = isRealDataType( 'uint8' );
// returns true

bool = isRealDataType( 'uint8c' );
// returns true

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

bool = isRealDataType( '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

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.