15.10 - FLOAT/REAL/DOUBLE PRECISION Data Types - Teradata Database

Teradata Database SQL Data Types and Literals

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1143-151K

Represent values in sign/magnitude form ranging from 2.226 x 10-308 to 1.797 x 10308.

where:

 

Syntax element …

Specifies …

attributes

appropriate data type attributes, column storage attributes, or column constraint attributes.

See “Core Data Type Attributes” on page 17 and “Storage and Constraint Attributes” on page 18 for specific information.

REAL and DOUBLE PRECISION are in the ANSI SQL:2011 standard. FLOAT is a Teradata synonym for REAL and DOUBLE PRECISION.

Eight bytes are used to hold a floating point value.

Floating point values are stored and manipulated internally in IEEE floating point format. Floating point values are stored with the least significant byte first, with one bit for the mantissa sign, 11 bits for the exponent, and 52 bits for the mantissa. The mantissa sign is in the most significant bit position; the exponent sign is a part of the exponent field (excess‑1024 notation, in which (1024 - exponent) = sign).

Negative numbers differ from positive numbers of the same magnitude only in the sign bit.

Teradata Database supports normalized, but not non-normalized, client floating point values.

The range of IEEE floating point values may be wider than that supported by the client system. Therefore, values can be created and stored in Teradata Database that return error messages when converted for delivery to the client system.

The following table lists the client representations for the Teradata FLOAT/REAL/DOUBLE PRECISION data type.

Determining the application definitions and client data types is the responsibility of the application programmer.

 

Client CPU Architecture

Client Representation

IBM mainframe

Eight byte 64-bit (double precision) floating point number, most significant byte first, with the attributes as follows:

  • 1 bit represents the sign of the fraction.
  • 7 bits represent the unsigned power of 16 exponent stored as actual plus X’40’.
  • 56 bits represent the unsigned fraction.
  • UTS

    Eight byte 64-bit (double precision) floating point number, most significant byte first, with the attributes as follows:

  • 1 bit represents the sign of the fraction.
  • 7 bits represent the unsigned power of 16 exponent stored as actual plus X’40’.
  • 56 bits represent the unsigned fraction.
  • RISC
  • Motorola 68000
  • WE 32000
  • Eight byte 64-bit (double precision) floating point number, most significant byte first, with the attributes as follows:

  • 1 bit represents the sign of the fraction.
  • 11 bits represent the unsigned power of 2 exponent stored as actual plus X’3FFH’.
  • 52 bits represent the unsigned fraction.
  • Intel

    Eight byte 64-bit (double precision) floating point number, least significant byte first, with the attributes as follows:

  • 1 bit represents the sign of the fraction.
  • 11 bits represent the unsigned power of 2 exponent stored as actual plus X’3FFH’.
  • 52 bits represent the unsigned fraction.
  • In the following table definition, column SalaryFactor is a FLOAT data type:

       CREATE TABLE Salaries
         (Id CHAR(9)
         ,SalaryFactor FLOAT BETWEEN .1 AND 1E1 );
     

    FOR information on …

    SEE …

    potential problems associated with floating point values in comparisons and computations

    “Operations on Floating Point Values” on page 120.

    rounding and FLOAT/REAL/DOUBLE PRECISION types

    “Rounding FLOAT, REAL, DOUBLE PRECISION Data Types” on page 124.