Approximate Numeric Data Types

An approximate numeric data type represents numeric values approximately.
(explicit id andt001) andt001

Approximate Numeric Data Type

{ { DECIMAL | DEC | NUMERIC } { [](16) | (precision) } | { FLOAT | DOUBLE PRECISION } [ (float_precision ) ] | { []SMALLFLOAT | REAL } }
Element Description Restrictions Syntax
float_precision The float_precision is ignored, but is ANSI/ISO compliant. Must be a positive integer. Specified value has no effect. Literal Number
precision Significant digits. Default is 16. An integer; 1 precision 32 Literal Number

Use approximate numeric data types for very large and very small numbers that can tolerate some degree of rounding during arithmetic operations.

The following table summarizes the built-in approximate numeric data types.
Data Type Description
DEC(p) Synonym for DECIMAL(p)
DECIMAL(p)

Stores floating-point decimal values in the approximate range from 1.0E-130 to 9.99E+126

The p parameter specifies the precision. If no precision is specified, the default is 16. This floating-point data type is available as an approximate numeric type only in a database that is not ANSI-compliant. In an ANSI-compliant database, DECIMAL(p) is implemented as a fixed-point DECIMAL; see Exact Numeric Data Types.

DOUBLE PRECISION ANSI-compliant synonym for FLOAT. The float_precision term is not valid when you use this synonym in data type declarations.
FLOAT Stores double-precision floating-point numbers with up to 16 significant digits. The float-precision parameter is accepted in data-type declarations for compliance with the ANSI/ISO standard for SQL, but this parameter has no effect on the actual precision of values that the database server stores.
NUMERIC(p) ANSI-compliant synonym for DECIMAL(p) In an ANSI-compliant database, this is implemented as an exact numeric type, with the specified precision and a scale of zero, rather than an approximate numeric (floating-point) data type.
REAL ANSI-compliant synonym for SMALLFLOAT
SMALLFLOAT Stores single-precision floating-point numbers with approximately 8 significant digits

The built-in number data types of Informix® database servers support real numbers. They cannot directly store imaginary or complex numbers.

In Informix®, you must create a user-defined data type for applications that support values that can have an imaginary part.

No more than nine arguments to an external UDR can be DECIMAL data types of SQL that the UDR declares as BigDecimal data types of the Java language.

1 Informix® extension