All Products
Search
Document Center

Overview of numeric data types

Last Updated: Jun 18, 2021

ApsaraDB for OceanBase allows you to store numeric values in the NUMBER, FLOAT, BINARY_FLOAT, and BINARY_DOUBLE data types. You can store fixed-point numbers, floating-point numbers, and zero by using these numeric data types. In numeric calculations, the numeric data types have different operator precedence values. For more information, see Precedence of numeric data types.

Data type

Length (bytes)

Description

NUMBER

4~40

NUMBER(p,s) stores variable-length fixed-point numbers that have decimal precisions. You can also store floating-point numbers by using NUMBER where p and s are not specified.

FLOAT

4~40

FLOAT(p) is a subtype of the NUMBER data type. The binary precision ranges from 1 to 126. A value of FLOAT is not a floating-point number.

BINARY_FLOAT

4

This data type stores 32-bit single-precision floating-point numbers that have binary precisions.

BINARY_DOUBLE

8

This data type stores 64-bit double-precision floating-point numbers that have binary precisions.