10000 GitHub - stdlib-js/array-typed-float-dtypes at 11622bb9bb52405a7abe7b1a39e6abd0876b8381
[go: up one dir, main page]

Skip to content

stdlib-js/array-typed-float-dtypes

Repository files navigation

Data Types

NPM version Build Status Coverage Status

List of typed array floating-point data types.

Installation

npm install @stdlib/array-typed-float-dtypes

Alternatively,

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

Usage

var dtypes = require( '@stdlib/array-typed-float-dtypes' );

dtypes()

Returns a list of typed array floating-point data types.

var out = dtypes();
// e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]

The output array contains the following data types:

  • float32: single-precision floating-point numbers.
  • float64: double-precision floating-point numbers.
  • complex64: single-precision complex floating-point numbers.
  • complex128: double-precision complex floating-point numbers.

Examples

var indexOf = require( '@stdlib/utils-index-of' );
var dtypes = require( '@stdlib/array-typed-float-dtypes' );

var DTYPES = dtypes();

function isdtype( str ) {
    if ( indexOf( DTYPES, str ) === -1 ) {
        return false;
    }
    return true;
}

var bool = isdtype( 'float64' );
// returns true

bool = isdtype( 'complex128' );
// returns true

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

bool = isdtype( 'beep' );
// 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-2022. The Stdlib Authors.

0