|
39 | 39 | function enumerated() { |
40 | 40 | // NOTE: the following should match the C `dtypes.h` enumeration!!!! |
41 | 41 | return { |
42 | | - // 'bool': 0, // uncomment once supported |
| 42 | + // Boolean data types: |
| 43 | + 'bool': 0, |
43 | 44 |
|
44 | | - 'int8': 0, |
45 | | - 'uint8': 1, |
46 | | - 'int16': 2, |
47 | | - 'uint16': 3, |
48 | | - 'int32': 4, |
49 | | - 'uint32': 5, |
50 | | - 'int64': 6, |
51 | | - 'uint64': 7, |
52 | | - // 'int128': 9, // uncomment once supported |
53 | | - // 'uint128': 10, // uncomment once supported |
54 | | - // 'int256': 11, // uncomment once supported |
55 | | - // 'uint256': 12, // uncomment once supported |
| 45 | + // Integer data types: |
| 46 | + 'int8': 1, |
| 47 | + 'uint8': 2, |
| 48 | + 'uint8c': 3, |
| 49 | + 'int16': 4, |
| 50 | + 'uint16': 5, |
| 51 | + 'int32': 6, |
| 52 | + 'uint32': 7, |
| 53 | + 'int64': 8, |
| 54 | + 'uint64': 9, |
| 55 | + // 'int128': 10, // uncomment once supported |
| 56 | + // 'uint128': 11, |
| 57 | + // 'int256': 12, |
| 58 | + // 'uint256': 13, |
56 | 59 |
|
57 | | - // 'float16': 13, // uncomment once supported |
58 | | - 'float32': 8, |
59 | | - 'float64': 9, |
60 | | - // 'float128': 16, // uncomment once supported |
| 60 | + // Floating-point data types: |
| 61 | + // 'float16': 14, |
| 62 | + 'float32': 10, |
| 63 | + 'float64': 11, |
| 64 | + // 'float128': 17, // uncomment once supported |
61 | 65 |
|
62 | | - // Define a signaling value which is guaranteed not to be a valid type enumeration value: |
63 | | - 'notype': 11, |
| 66 | + // Complex floating-point number data types: |
| 67 | + // 'complex64': 18, // uncomment once supported |
| 68 | + // 'complex128': 19, |
64 | 69 |
|
65 | | - // The following is a special dtype, which is, in more recent Node.js versions, effectively equivalent to `uint8` when calling into C; however, in older Node.js versions, the `Buffer` object was not based on the `Uint8Array` typed array. Here, we treat "binary" as an alias for `uint8`. |
66 | | - 'binary': 1, |
| 70 | + // Data type for "binary" data (i.e., data stored in a Node.js `Buffer` object): |
| 71 | + 'binary': 12, |
67 | 72 |
|
68 | | - // The following is a special dtype which is only applicable in JavaScript, not in C. Here, we treat "uint8c" as an alias for `uint8`. |
69 | | - 'uint8c': 1, |
| 73 | + // Data type for "generic" JavaScript values (objects): |
| 74 | + 'generic': 13, |
70 | 75 |
|
71 | | - // The following corresponds to a "generic" JavaScript `Array` instance. This has no equivalent native C type. |
72 | | - 'generic': 11, |
| 76 | + // Define a signaling value which is guaranteed not to be a valid type enumeration value: |
| 77 | + 'notype': 15, |
73 | 78 |
|
74 | 79 | // Indicate the start of user defined type numbers (leaving room for type growth above): |
75 | 80 | 'userdefined_type': 256 |
|
0 commit comments