Declares literal strings of floating point numbers in an expression.
Syntax
[ + | - ] { nE | n.E | .nE | n.nE } [ + | - ] m
Syntax Elements
- +, -
- An optional sign.
- n
- Any valid integer representing the whole and, optionally, fractional 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.
Components of Floating Point Literals
Floating point literals consist of the following components, reading from left-to-right:
- Optional sign
- Sequence of digits (including none) representing the whole number portion of the mantissa
- Optional decimal point
- Sequence of digits (including none) representing the fractional portion of the mantissa
- Literal character E
- Optional sign
- 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.
The second optional sign must immediately follow the literal character E and come before the sequence of digits representing the exponent. However, Teradata does not issue a syntax error if you specify the sign in the middle of the digits representing the exponent or after the digits representing the exponent.
Floating Point Literal Data Types
Floating point literals are treated as having a FLOAT data type, which is treated as equivalent to:
- REAL
- DOUBLE PRECISION
Examples: Floating Point Literals
The following numbers are examples of floating point literals.
1E100 3.14E-10 6.023E23
Related Information
Topic | Reference |
---|---|
|
FLOAT/REAL/DOUBLE PRECISION Data Types. |
Potential problems associated with floating point values in comparisons and computations | Operations on Floating-Point Values. |