@stdlib/ndarray-base-output-policy-resolve-str
v0.2.2
Published
Return the policy string associated with a supported ndarray data type policy value.
Downloads
2
Readme
resolve
Return the policy string associated with a supported ndarray data type policy value.
Installation
npm install @stdlib/ndarray-base-output-policy-resolve-str
Usage
var resolve = require( '@stdlib/ndarray-base-output-policy-resolve-str' );
resolve( dtype )
Returns the policy string associated with an ndarray data type policy value.
var str2enum = require( '@stdlib/ndarray-base-output-policy-str2enum' );
var v = resolve( 'same' );
// returns 'same'
v = resolve( str2enum( 'same' ) );
// returns 'same'
If unable to resolve a policy string, the function returns null
.
var v = resolve( 'beep' );
// returns null
Examples
var str2enum = require( '@stdlib/ndarray-base-output-policy-str2enum' );
var resolve = require( '@stdlib/ndarray-base-output-policy-resolve-str' );
var v = resolve( str2enum( 'same' ) );
// returns 'same'
v = resolve( str2enum( 'promoted' ) );
// returns 'promoted'
v = resolve( str2enum( 'signed_integer' ) );
// returns 'signed_integer'
v = resolve( str2enum( 'unsigned_integer' ) );
// returns 'unsigned_integer'
v = resolve( str2enum( 'floating_point' ) );
// returns 'floating_point'
v = resolve( str2enum( 'integer' ) );
// returns 'integer'
v = resolve( str2enum( 'real_floating_point' ) );
// returns 'real_floating_point'
v = resolve( str2enum( 'complex_floating_point' ) );
// returns 'complex_floating_point'
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
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.