@@ -40,7 +40,7 @@ limitations under the License.
4040var dtypes = require ( ' @stdlib/array/dtypes' );
4141```
4242
43- #### dtypes()
43+ #### dtypes( \[ kind ] )
4444
4545Returns a list of array data types.
4646
@@ -49,7 +49,7 @@ var out = dtypes();
4949// e.g., returns [ 'float32', 'float64', 'generic', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex64', 'complex128' ]
5050```
5151
52- The output ` array ` contains the following data types:
52+ When not provided a data type "kind", the function returns an array containing the following data types:
5353
5454- ` float32 ` : single-precision floating-point numbers.
5555- ` float64 ` : double-precision floating-point numbers.
@@ -64,6 +64,25 @@ The output `array` contains the following data types:
6464- ` uint8 ` : unsigned 8-bit integers.
6565- ` uint8c ` : unsigned clamped 8-bit integers.
6666
67+ To return the subset of data types belonging to a specified data type kind, provide a ` kind ` argument.
68+
69+ ``` javascript
70+ var out = dtypes ( ' floating_point' );
71+ // returns [...]
72+ ```
73+
74+ The function supports the following data type kinds:
75+
76+ - ` floating_point ` : floating-point data types.
77+ - ` real_floating_point ` : real-valued floating-point data types.
78+ - ` complex_floating_point ` : complex-valued floating-point data types.
79+ - ` integer ` : integer data types.
80+ - ` signed_integer ` : signed integer data types.
81+ - ` unsigned_integer ` : unsigned integer data types.
82+ - ` real ` : real-valued data types.
83+ - ` numeric ` : numeric data types.
84+ - ` all ` : all data types.
85+
6786</section >
6887
6988<!-- /.usage -->
@@ -89,7 +108,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
89108var dtypes = require ( ' @stdlib/array/dtypes' );
90109
91110var DTYPES = dtypes ();
92- var bool;
93111
94112function isdtype ( str ) {
95113 if ( indexOf ( DTYPES , str ) === - 1 ) {
@@ -98,7 +116,7 @@ function isdtype( str ) {
98116 return true ;
99117}
100118
101- bool = isdtype ( ' float64' );
119+ var bool = isdtype ( ' float64' );
102120// returns true
103121
104122bool = isdtype ( ' int16' );
0 commit comments