[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question on the range of floats in Emacs
From: |
Eli Zaretskii |
Subject: |
Re: A question on the range of floats in Emacs |
Date: |
Wed, 18 Jul 2007 06:19:53 +0300 |
> From: Jay Belanger <address@hidden>
> Date: Tue, 17 Jul 2007 15:41:12 -0500
> Cc: address@hidden
>
> I played around with the largest and smallest floats, and I
> was wondering about precision. Near the smallest float, the precision
> can be small; on my computer, 5e-324, 5.1e-324 and 4.9e-324 all evaluate to
> 5e-324; 3.47e-323 evaluates to 3.5e-324, etc. Is there a range (say
> from smallest-exponent + N to largest-exponent - N) in which the
> precision is fixed? (It appears that way here; is it true in general?)
The numbers where you see the loss of precision are denormalized
(i.e. some of the mantissa bits are zero). The range you are looking
for (where there's no loss of precision) is between
least-positive-normalized-float and most-positive-float.