HDFql Reference Manual v2.6.0

6.1.3SMALLINT

The HDFql SMALLINT data type stores values between -32,768 and 32,767 and occupies 2 bytes in memory. It represents the data type of an HDF5 H5T_NATIVE_SHORT dataset/attribute or of a result set that stores elements of this type (which can be retrieved using the HDFQL_CURSOR_GET_SMALLINT function when working with cursors). Depending on the programming language supported by HDFql, the SMALLINT data type is represented by:

  • In C, the “short” data type.
  • In C++, the “short” data type.
  • In Java, the “short” data type (or corresponding wrapper class “Short”).
  • In Python, the “int16” NumPy data type.
  • In C#, the “Int16” data type (or corresponding alias “short”).
  • In Fortran, the “INTEGER(KIND = 2)” data type.
  • In R5, the “integer” data type.
  • In MATLAB, the “int16” data type.

Notes

  1. By design, R does not provide a data type that stores values between -32,768 and 32,767 using exactly 2 bytes of 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). ↩