6.1.15UNSIGNED VARSMALLINT
The HDFql UNSIGNED VARSMALLINT data type stores values between 0 and 65,535 and occupies 2 bytes in memory (per element). It represents the data type of an HDF5 (variable-length) H5T_NATIVE_USHORT dataset/attribute or of a result set that stores variable-length elements of this type (which can be retrieved using the HDFQL_CURSOR_GET_UNSIGNED_SMALLINT and HDFQL_SUBCURSOR_GET_UNSIGNED_SMALLINT functions when working with cursors). Depending on the programming language supported by HDFql, the UNSIGNED VARSMALLINT data type is represented by:
- In C, the “unsigned short” data type.
- In C++, the “unsigned short” data type.
- In Java22, the “ArrayList<Short>” class.
- In Python, the “uint16” NumPy data type.
- In C#, the “UInt16” data type (or corresponding alias “ushort”).
- In Fortran23, the “INTEGER(KIND = 2)” data type.
- In R24, the “integer” data type.
- In MATLAB, the “uint16” data type.
Notes
- By design, Java does not support unsigned data types. Therefore, the programmer is responsible for converting a signed number to its equivalent unsigned representation in Java. ↩
- Although there have been some efforts to introduce unsigned data types in Fortran, none are currently standardized. Therefore, the programmer is responsible for converting a signed number to its equivalent unsigned representation in Fortran. ↩
- By design, R does not provide a data type that stores values between 0 and 65,535 using exactly 2 bytes in memory. As a substitute, the R “integer” data type may be used, at the cost of increased memory usage (as it occupies 4 bytes of memory) and lower performance (as byte alignment must be performed by HDFql). ↩