SMALLFLOAT, REAL
float
Single-precision values with up to 8 significant digits
FLOAT, DOUBLE PRECISION
double
Double-precision values with up to 16 significant digits
DECIMAL(p)
decimal
Absolute value range between 10-130 and 10124
Declaring float Host Variables When you use the C float data type (for SMALLFLOAT values), be aware that most C compilers pass float to a function as the double data type. If you declare the function argument as a float, you might receive an incorrect result. For example, in the following excerpt, :hostvar might produce an incorrect value in tab1, depending on how your C compiler handles the float data type when your program passes it as an argument.
Implicit Data Conversion When an ESQL/C program fetches a floating-point column value (data type of DECIMAL(n), FLOAT, or SMALLFLOAT) into a character host variable (char, fixchar, varchar, or string), it includes only the number of decimal digits that can fit into the character buffer. If the host variable is too small for the full precision of the floating-point number, ESQL/C rounds the number to the precision that the host variable can hold. In the following code fragment, an ESQL/C program retrieves the value 1234.8763512 from a FLOAT column that is called principal into the prncpl_strng character host variable:
1234.8763512