Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

FLOAT/REAL

Description

The FLOAT (or REAL) data type is used to represent floating point numbers. The value range is available from -3.402823466E+38 to -1.175494351E-38, 0, and from +1.175494351E-38 to +3.402823466E+38. It conforms to the ANSI/IEEE 754-1985 standard.

The minimum value for the precision p is 1 and the maximum value is 38. When the precision p is omitted or it is specified as seven or less, the data is represented as single precision (in seven significant figures) and it is converted into the DOUBLE data type.

FLOAT[(p)]

Remark
  • FLOAT is in seven significant figures.
  • Representable range is different based on system where CUBRID is running.
  • Extra cautions are required when comparing data because the FLOAT type stores approximate numeric.
  • FLOAT and REAL are used interchangeably.
Example

If you specify -1234.56789 as FLOAT, -1.234568e+003 is stored (if precision is omitted, 8th digit is rounded because it is represented as seven significant figures).

If you specify 1234.56789 as FLOAT(5), 1.234568e+003 is stored (if precision is in seven or less, 8th digit is rounded because it is represented as seven significant figures).

If you specify 12345678.9 as FLOAT(5), 1.234568e+007 is stored (if precision is in seven or less, 8th digit is rounded because it is represented as seven significant figures).

If you specify 12345678.9 as FLOAT(10), 1.234567890000000e+007 is stored (if precision is in seven or greater and 38 or less, 0s are filled because it is represented as 15 significant figures).