File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ var isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-co
44
44
45
45
#### isComplexFloatingPointDataType( value )
46
46
47
- Tests if an input ` value ` is a supported ndarray complex-valued floating-point data type.
47
+ Tests if an input value is a supported ndarray complex-valued floating-point data type.
48
48
49
49
<!-- eslint-disable id-length -->
50
50
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ var contains = require( '@stdlib/array/base/assert/contains' ).factory;
24
24
var dtypes = require ( '@stdlib/ndarray/dtypes' ) ;
25
25
26
26
27
+ // VARIABLES //
28
+
29
+ var isDataType = contains ( dtypes ( 'complex_floating_point' ) ) ;
30
+
31
+
27
32
// MAIN //
28
33
29
34
/**
@@ -77,7 +82,9 @@ var dtypes = require( '@stdlib/ndarray/dtypes' );
77
82
* bool = isComplexFloatingPointDataType( 'foo' );
78
83
* // returns false
79
84
*/
80
- var isComplexFloatingPointDataType = contains ( dtypes ( 'complex_floating_point' ) ) ; // eslint-disable-line id-length
85
+ function isComplexFloatingPointDataType ( v ) { // eslint-disable-line id-length
86
+ return isDataType ( String ( v ) ) ;
87
+ }
81
88
82
89
83
90
// EXPORTS //
Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var tape = require ( 'tape' ) ;
24
+ var DataType = require ( '@stdlib/ndarray/dtype-ctor' ) ;
24
25
var isComplexFloatingPointDataType = require ( './../lib' ) ; // eslint-disable-line id-length
25
26
26
27
@@ -39,7 +40,9 @@ tape( 'the function returns `true` if provided a supported ndarray complex-value
39
40
40
41
values = [
41
42
'complex64' ,
42
- 'complex128'
43
+ 'complex128' ,
44
+ new DataType ( 'complex64' ) ,
45
+ new DataType ( 'complex128' )
43
46
] ;
44
47
for ( i = 0 ; i < values . length ; i ++ ) {
45
48
bool = isComplexFloatingPointDataType ( values [ i ] ) ;
@@ -67,6 +70,8 @@ tape( 'the function returns `false` if not provided a supported ndarray complex-
67
70
'int8' ,
68
71
'generic' ,
69
72
73
+ new DataType ( 'generic' ) ,
74
+
70
75
// Unsupported dtypes:
71
76
'float' ,
72
77
'int' ,
You can’t perform that action at this time.
0 commit comments