SMALLFLOAT

 

SMALLFLOAT is a numeric data type that is used to store values in the format of single-precision floating-point binary numbers. They can have up to 8 significant digits and usually require 4 bytes for storage.

 

REAL is a synonym for SMALLFLOAT.

 

 

 

SMALLFLOAT, as well as FLOAT data type, is generally used to store data that do not require high precision and can be calculated only approximately. The data entered into a table column of SMALLFLOAT data type can differ from the data 4GL will display, because the SMALLFLOAT data type stores only most significant digits. Such error occurs because the floating-point numbers are stored internally in binary format.

 

If you enter ā€˜1.1ā€™ into a table column of SMALLFLOAT data type, Querix 4GL will display it as 1.1000001. The floating-point binary for the value entered using decimal format may require an infinite number of digits, whereas only a finite number of digits can be physically stored. So an approximate value is stored.

 

A SMALLFLOAT value can be specified as a floating-point literal with the following structure:

 

 

The mantissa and exponent signs are optional. If they are omitted, they will be treated as positive by default. In the floating-point literals you can use ā€˜Eā€™ (either upper or lower case) as the exponent symbol.

 

If another number format is entered into a SMALLFLOAT field, or of it is supplied by the program, Querix 4GL makes an attempt to convert it into the SMALLFLOAT data type. You can use the USING operator to format the numbers of the SMALLFLOAT data type. Two decimal digits will be displayed by default.