summaryrefslogtreecommitdiff
path: root/devdocs/elisp/floating_002dpoint-type.html
blob: 5b0ecee45a71bff45979cbdeb2cac85e3fba9668 (plain)
1
2
3
4
5
6
 <h4 class="subsection">Floating-Point Type</h4> <p>Floating-point numbers are the computer equivalent of scientific notation; you can think of a floating-point number as a fraction together with a power of ten. The precise number of significant figures and the range of possible exponents is machine-specific; Emacs uses the C data type <code>double</code> to store the value, and internally this records a power of 2 rather than a power of 10. </p> <p>The printed representation for floating-point numbers requires either a decimal point (with at least one digit following), an exponent, or both. For example, ‘<samp>1500.0</samp>’, ‘<samp>+15e2</samp>’, ‘<samp>15.0e+2</samp>’, ‘<samp>+1500000e-3</samp>’, and ‘<samp>.15e4</samp>’ are five ways of writing a floating-point number whose value is 1500. They are all equivalent. </p> <p>See <a href="numbers">Numbers</a>, for more information. </p><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Floating_002dPoint-Type.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Floating_002dPoint-Type.html</a>
  </p>
</div>