Number literals include exact-value (integer and
DECIMAL) literals and
approximate-value (floating-point) literals.
Integers are represented as a sequence of digits. Numbers may
. as a decimal separator. Numbers may
be preceded by
indicate a negative or positive value, respectively. Numbers
represented in scientific notation with a mantissa and exponent
are approximate-value numbers.
Exact-value numeric literals have an integer part or fractional
part, or both. They may be signed. Examples:
Approximate-value numeric literals are represented in scientific
notation with a mantissa and exponent. Either or both parts may
be signed. Examples:
Two numbers that look similar may be treated differently. For
2.34 is an exact-value (fixed-point)
2.34E0 is an
approximate-value (floating-point) number.
DECIMAL data type is a
fixed-point type and calculations are exact. In MySQL, the
DECIMAL type has several
FIXED. The integer types also are
exact-value types. For more information about exact-value
calculations, see Section 12.22, “Precision Math”.
DOUBLE data types are
floating-point types and calculations are approximate. In MySQL,
types that are synonymous with
DOUBLE PRECISION and
An integer may be used in floating-point context; it is interpreted as the equivalent floating-point number.