SMALLFLOAT data type

The SQL SMALLFLOAT data type can hold single-precision floating-point values. The DataBlade® API supports the SMALLFLOAT data type with the mi_real data type. The mi_real data type stores internal SMALLFLOAT values, as 32-bit floating-point values.

Server only:

Although an mi_real value can fit into an MI_DATUM structure, values of this data type are always passed by reference. Unlike other four-byte values, mi_real values cannot be passed by value. All values greater than four bytes are passed by reference.

Therefore, if a UDR is called from an SQL statement, the database server passed a pointer to any mi_real arguments; it does not pass the actual value. Similarly, if a user-defined function returns an mi_real value to an SQL statement, you must allocate space for the value, fill this space, and return a pointer to this space.

DataBlade API modules that are not invoked from SQL statements might pass mi_real values by value. However, for consistency, you might want to pass them by reference.

Client only: All data types, including mi_real, must be passed by reference within client LIBMI applications.
Important: To make your DataBlade API module portable across different architectures, it is recommended that you use the DataBlade API data type, mi_real, instead of the native C-language counterpart, float. The mi_real data type handles the different sizes of small floating-point values across computer architectures.