<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="number-literals">
      </a>
      11.1.2 Numeric Literals
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045220470192">
  </a>
  <a class="indexterm" name="idm46045220469104">
  </a>
  <a class="indexterm" name="idm46045220468016">
  </a>
  <a class="indexterm" name="idm46045220466528">
  </a>
  <a class="indexterm" name="idm46045220465040">
  </a>
  <a class="indexterm" name="idm46045220463552">
  </a>
  <a class="indexterm" name="idm46045220462480">
  </a>
  <a class="indexterm" name="idm46045220460992">
  </a>
  <a class="indexterm" name="idm46045220459920">
  </a>
  <a class="indexterm" name="idm46045220458848">
  </a>
  <a class="indexterm" name="idm46045220457776">
  </a>
  <a class="indexterm" name="idm46045220456704">
  </a>
  <p>
   Number literals include exact-value (integer and
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     DECIMAL
    </code>
   </a>
   ) literals and
        approximate-value (floating-point) literals.
  </p>
  <p>
   Integers are represented as a sequence of digits. Numbers may
        include
   <code class="literal">
    .
   </code>
   as a decimal separator. Numbers may
        be preceded by
   <code class="literal">
    -
   </code>
   or
   <code class="literal">
    +
   </code>
   to
        indicate a negative or positive value, respectively. Numbers
        represented in scientific notation with a mantissa and exponent
        are approximate-value numbers.
  </p>
  <p>
   Exact-value numeric literals have an integer part or fractional
        part, or both. They may be signed. Examples:
   <code class="literal">
    1
   </code>
   ,
   <code class="literal">
    .2
   </code>
   ,
   <code class="literal">
    3.4
   </code>
   ,
   <code class="literal">
    -5
   </code>
   ,
   <code class="literal">
    -6.78
   </code>
   ,
   <code class="literal">
    +9.10
   </code>
   .
  </p>
  <p>
   Approximate-value numeric literals are represented in scientific
        notation with a mantissa and exponent. Either or both parts may
        be signed. Examples:
   <code class="literal">
    1.2E3
   </code>
   ,
   <code class="literal">
    1.2E-3
   </code>
   ,
   <code class="literal">
    -1.2E3
   </code>
   ,
   <code class="literal">
    -1.2E-3
   </code>
   .
  </p>
  <p>
   Two numbers that look similar may be treated differently. For
        example,
   <code class="literal">
    2.34
   </code>
   is an exact-value (fixed-point)
        number, whereas
   <code class="literal">
    2.34E0
   </code>
   is an
        approximate-value (floating-point) number.
  </p>
  <p>
   The
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     DECIMAL
    </code>
   </a>
   data type is a
        fixed-point type and calculations are exact. In MySQL, the
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     DECIMAL
    </code>
   </a>
   type has several
        synonyms:
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     NUMERIC
    </code>
   </a>
   ,
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     DEC
    </code>
   </a>
   ,
   <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
    <code class="literal">
     FIXED
    </code>
   </a>
   . The integer types also are
        exact-value types. For more information about exact-value
        calculations, see
   <a class="xref" href="precision-math.html" title="14.24 Precision Math">
    Section 14.24, “Precision Math”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     FLOAT
    </code>
   </a>
   and
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     DOUBLE
    </code>
   </a>
   data types are
        floating-point types and calculations are approximate. In MySQL,
        types that are synonymous with
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     FLOAT
    </code>
   </a>
   or
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     DOUBLE
    </code>
   </a>
   are
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     DOUBLE PRECISION
    </code>
   </a>
   and
   <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
    <code class="literal">
     REAL
    </code>
   </a>
   .
  </p>
  <p>
   An integer may be used in floating-point context; it is
        interpreted as the equivalent floating-point number.
  </p>
 </div>
 <br/>
</div>
