Numeric types are used to store fixed-point numbers, floating-point numbers, and zero. OceanBase Database provides four numeric data types: NUMBER, FLOAT, BINARY_FLOAT, and BINARY_DOUBLE. This topic provides an overview of the numeric data types supported by the current version of OceanBase Database.
When performing numeric calculations, numeric types have different priorities. For more information, see Priorities of numeric types.
The following table describes the numeric data types supported by the current version of OceanBase Database.
| Data type | Length type | Length (bytes) | Description |
|---|---|---|---|
| NUMBER(p,s) | Variable length | [4,40] | Stores variable-length, decimal-precision fixed-point numbers. It can also store floating-point numbers, in which case the NUMBER type does not have the p and s parameters. |
| FLOAT(p) | Variable length | [4,40] | A subtype of the NUMBER data type. The binary precision ranges from 1 to 126. FLOAT is not a floating-point number. |
| BINARY_FLOAT | Fixed length | 4 | A 32-bit single-precision binary floating-point number. |
| BINARY_DOUBLE | Fixed length | 8 | A 64-bit double-precision binary floating-point number. |
