Skip to content

Commit aa50d4a

Browse files
committed
feat: add 16-bit data types
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c463921 commit aa50d4a

File tree

5 files changed

+51
-10
lines changed

5 files changed

+51
-10
lines changed

lib/node_modules/@stdlib/ndarray/dtypes/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ Returns a list of ndarray data types.
4646

4747
```javascript
4848
var out = dtypes();
49-
// e.g., returns [ 'binary', 'complex64', 'complex128', ... ]
49+
// e.g., returns [ 'binary', 'complex32', 'complex64', 'complex128', ... ]
5050
```
5151

5252
When not provided a data type "kind", the function returns an array containing the following data types:
5353

5454
- `binary`: binary.
5555
- `bool`: boolean values.
56+
- `complex32`: half-precision complex floating-point numbers.
5657
- `complex64`: single-precision complex floating-point numbers.
5758
- `complex128`: double-precision complex floating-point numbers.
59+
- `float16`: half-precision floating-point numbers.
5860
- `float32`: single-precision floating-point numbers.
5961
- `float64`: double-precision floating-point numbers.
6062
- `generic`: values of any type.

lib/node_modules/@stdlib/ndarray/dtypes/include/stdlib/ndarray/dtypes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ enum STDLIB_NDARRAY_DTYPE {
4949
// STDLIB_NDARRAY_UINT256,
5050

5151
// Floating-point data types:
52-
// STDLIB_NDARRAY_FLOAT16, // TODO: uncomment once supported
52+
STDLIB_NDARRAY_FLOAT16,
5353
// STDLIB_NDARRAY_BFLOAT16, // TODO: uncomment once supported
5454
STDLIB_NDARRAY_FLOAT32,
5555
STDLIB_NDARRAY_FLOAT64,
5656
// STDLIB_NDARRAY_FLOAT128 // TODO: uncomment once supported
5757

5858
// Complex floating-point number data types:
59+
STDLIB_NDARRAY_COMPLEX32,
5960
STDLIB_NDARRAY_COMPLEX64,
6061
STDLIB_NDARRAY_COMPLEX128,
6162

lib/node_modules/@stdlib/ndarray/dtypes/lib/dtypes.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"all": [
33
"binary",
44
"bool",
5+
"complex32",
56
"complex64",
67
"complex128",
8+
"float16",
79
"float32",
810
"float64",
911
"generic",
@@ -18,8 +20,10 @@
1820
"typed": [
1921
"binary",
2022
"bool",
23+
"complex32",
2124
"complex64",
2225
"complex128",
26+
"float16",
2327
"float32",
2428
"float64",
2529
"int16",
@@ -31,16 +35,20 @@
3135
"uint8c"
3236
],
3337
"floating_point": [
38+
"complex32",
3439
"complex64",
3540
"complex128",
41+
"float16",
3642
"float32",
3743
"float64"
3844
],
3945
"real_floating_point": [
46+
"float16",
4047
"float32",
4148
"float64"
4249
],
4350
"complex_floating_point": [
51+
"complex32",
4452
"complex64",
4553
"complex128"
4654
],
@@ -68,6 +76,7 @@
6876
"uint8c"
6977
],
7078
"real": [
79+
"float16",
7180
"float32",
7281
"float64",
7382
"int16",
@@ -79,8 +88,10 @@
7988
"uint8c"
8089
],
8190
"numeric": [
91+
"complex32",
8292
"complex64",
8393
"complex128",
94+
"float16",
8495
"float32",
8596
"float64",
8697
"int16",

lib/node_modules/@stdlib/ndarray/dtypes/lib/enum.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,25 @@ function enumeration() {
5959
// 'uint256': 13,
6060

6161
// Floating-point data types:
62-
// 'float16': 14,
62+
'float16': 10,
6363
// 'bfloat16': 15,
64-
'float32': 10,
65-
'float64': 11,
64+
'float32': 11,
65+
'float64': 12,
6666
// 'float128': 18, // uncomment once supported
6767

6868
// Complex floating-point number data types:
69-
'complex64': 12,
70-
'complex128': 13,
69+
'complex32': 13,
70+
'complex64': 14,
71+
'complex128': 15,
7172

7273
// Data type for "binary" data (i.e., data stored in a Node.js `Buffer` object):
73-
'binary': 14,
74+
'binary': 16,
7475

7576
// Data type for "generic" JavaScript values (objects):
76-
'generic': 15,
77+
'generic': 17,
7778

7879
// Define a signaling value which is guaranteed not to be a valid type enumeration value:
79-
'notype': 17,
80+
'notype': 18,
8081

8182
// Indicate the start of user defined type numbers (leaving room for type growth above):
8283
'userdefined_type': 256

lib/node_modules/@stdlib/ndarray/dtypes/test/test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ var DTYPES = [
3939
'int64',
4040
'uint64',
4141

42+
'float16',
4243
'float32',
4344
'float64',
4445

46+
'complex32',
4547
'complex64',
4648
'complex128',
4749

@@ -64,8 +66,10 @@ tape( 'the function returns a list of ndarray data types', function test( t ) {
6466
expected = [
6567
'binary',
6668
'bool',
69+
'complex32',
6770
'complex64',
6871
'complex128',
72+
'float16',
6973
'float32',
7074
'float64',
7175
'generic',
@@ -90,8 +94,10 @@ tape( 'the function supports returning a list of ndarray data types (all)', func
9094
expected = [
9195
'binary',
9296
'bool',
97+
'complex32',
9398
'complex64',
9499
'complex128',
100+
'float16',
95101
'float32',
96102
'float64',
97103
'generic',
@@ -116,8 +122,10 @@ tape( 'the function supports returning a list of ndarray data types (all, includ
116122
expected = [
117123
'binary',
118124
'bool',
125+
'complex32',
119126
'complex64',
120127
'complex128',
128+
'float16',
121129
'float32',
122130
'float64',
123131
'generic',
@@ -142,8 +150,10 @@ tape( 'the function supports returning a list of ndarray data types (typed)', fu
142150
expected = [
143151
'binary',
144152
'bool',
153+
'complex32',
145154
'complex64',
146155
'complex128',
156+
'float16',
147157
'float32',
148158
'float64',
149159
'int16',
@@ -167,8 +177,10 @@ tape( 'the function supports returning a list of ndarray data types (typed, incl
167177
expected = [
168178
'binary',
169179
'bool',
180+
'complex32',
170181
'complex64',
171182
'complex128',
183+
'float16',
172184
'float32',
173185
'float64',
174186
'int16',
@@ -191,8 +203,10 @@ tape( 'the function supports returning a list of floating-point ndarray data typ
191203
var actual;
192204

193205
expected = [
206+
'complex32',
194207
'complex64',
195208
'complex128',
209+
'float16',
196210
'float32',
197211
'float64'
198212
];
@@ -207,8 +221,10 @@ tape( 'the function supports returning a list of floating-point ndarray data typ
207221
var actual;
208222

209223
expected = [
224+
'complex32',
210225
'complex64',
211226
'complex128',
227+
'float16',
212228
'float32',
213229
'float64',
214230
'generic'
@@ -224,6 +240,7 @@ tape( 'the function supports returning a list of real-valued floating-point ndar
224240
var actual;
225241

226242
expected = [
243+
'float16',
227244
'float32',
228245
'float64'
229246
];
@@ -238,6 +255,7 @@ tape( 'the function supports returning a list of real-valued floating-point ndar
238255
var actual;
239256

240257
expected = [
258+
'float16',
241259
'float32',
242260
'float64',
243261
'generic'
@@ -253,6 +271,7 @@ tape( 'the function supports returning a list of complex-valued floating-point n
253271
var actual;
254272

255273
expected = [
274+
'complex32',
256275
'complex64',
257276
'complex128'
258277
];
@@ -267,6 +286,7 @@ tape( 'the function supports returning a list of complex-valued floating-point n
267286
var actual;
268287

269288
expected = [
289+
'complex32',
270290
'complex64',
271291
'complex128',
272292
'generic'
@@ -412,6 +432,7 @@ tape( 'the function supports returning a list of real-valued ndarray data types'
412432
var actual;
413433

414434
expected = [
435+
'float16',
415436
'float32',
416437
'float64',
417438
'int16',
@@ -433,6 +454,7 @@ tape( 'the function supports returning a list of real-valued ndarray data types
433454
var actual;
434455

435456
expected = [
457+
'float16',
436458
'float32',
437459
'float64',
438460
'int16',
@@ -455,8 +477,10 @@ tape( 'the function supports returning a list of numeric ndarray data types', fu
455477
var actual;
456478

457479
expected = [
480+
'complex32',
458481
'complex64',
459482
'complex128',
483+
'float16',
460484
'float32',
461485
'float64',
462486
'int16',
@@ -478,8 +502,10 @@ tape( 'the function supports returning a list of numeric ndarray data types (inc
478502
var actual;
479503

480504
expected = [
505+
'complex32',
481506
'complex64',
482507
'complex128',
508+
'float16',
483509
'float32',
484510
'float64',
485511
'int16',

0 commit comments

Comments
 (0)