The numeric data types store fixed-point numbers, floating-point numbers, and zeros. OceanBase Database provides four numeric data types: NUMBER, FLOAT, BINARY_FLOAT, and BINARY_DOUBLE. This topic describes numeric data types supported by OceanBase Database.
The priorities of different numeric data types are different. For more information, see Precedence of numeric data types.
The following table lists numeric data types supported by OceanBase Database.
| Data type | Fixed/Variable length | Length (bytes) | Consideration |
|---|---|---|---|
| NUMBER(p,s) | Variable | [4,40] | The variable-length fixed-point numbers with decimal precision or floating-point numbers. When it is the data type of floating-point numbers, the NUMBER data type does not include the p and s parameters. |
| FLOAT(p) | Variable | [4,40] | A subtype of the NUMBER data type. Binary precision range: [1,126]. FLOAT does not indicate floating-point numbers. |
| BINARY_FLOAT | Fixed | 4 | The floating-point numbers with binary precision. It is the data type of the floating-point numbers with 32-bit single precision. |
| BINARY_DOUBLE | Fixed | 8 | The floating-point numbers with binary precision. It is the data type of the floating-point numbers with 64-bit double precision. |