15.10 - Floating Point Literals - Teradata Database

Teradata Database SQL Data Types and Literals

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

Declares literal strings of floating point numbers in an expression.

where:

 

Syntax element …

Specifies …

+, -

an optional sign.

The default is +.

n

any valid integer representing the whole and, optionally, fractional component of the mantissa.

The total number of digits cannot exceed 15, excluding leading zeros in the whole component of the mantissa.

E

the symbol indicating that what follows is the exponent for the number.

m

any valid integer number representing the exponent for the number.

The total number of digits cannot exceed three, including leading zeros.

Floating point literals consist of the following components, reading from left-to-right:

1 Optional sign

2 Sequence of digits (including none) representing the whole number portion of the mantissa

3 Optional decimal point

4 Sequence of digits (including none) representing the fractional portion of the mantissa

5 Literal character E

6 Optional sign

7 Sequence of digits (including none) representing the exponent

Spaces and new line characters are not allowed in a literal except after the first optional sign.

Floating point literals are treated as having a FLOAT data type, which is treated as equivalent to:

  • REAL
  • DOUBLE PRECISION
  • The following numbers are examples of floating point literals.

    1E100
    3.14E-10
    6.023E23
     

    FOR information on …

    SEE …

  • FLOAT data types
  • REAL data types
  • DOUBLE PRECISION data types
  • “FLOAT/REAL/DOUBLE PRECISION Data Types” on page 113.

    potential problems associated with floating point values in comparisons and computations

    “Operations on Floating Point Values” on page 120.