SMALLFLOAT

 

The SMALLFLOAT data type stores single-precision floating-point numbers with approximately eight significant digits. SMALLFLOAT data types usually require 4 bytes per value.

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.

 

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.