(lispref.info)Float Basics


Next: Predicates on Numbers Prev: Integer Basics Up: Numbers

Floating Point Basics
=====================

   Emacs version 19 supports floating point numbers, if compiled with
the macro `LISP_FLOAT_TYPE' defined.  The precise range of floating
point numbers is machine-specific; it is the same as the range of the C
data type `double' on the machine in question.

   The printed representation for floating point numbers requires either
a decimal point (with at least one digit following), an exponent, or
both.  For example, `1500.0', `15e2', `15.0e2', `1.5e3', and `.15e4'
are five ways of writing a floating point number whose value is 1500.
They are all equivalent.  You can also use a minus sign to write
negative floating point numbers, as in `-1.0'.

   You can use `logb' to extract the binary exponent of a floating
point number (or estimate the logarithm of an integer):

 - Function: logb NUMBER
     This function returns the binary exponent of NUMBER.  More
     precisely, the value is the logarithm of NUMBER base 2, rounded
     down to an integer.


automatically generated by info2www