On Sep 14, 4:05 pm, Scott David Daniels <scott.dani...@acm.org> wrote: > Steven D'Aprano wrote: > > On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: > > Exactly -- there are 2**53 distinct floats on most IEEE systems, the vast > > majority of which might as well be "random". What's the point of caching > > numbers like 2.5209481723210079? Chances are it will never come up again > > in a calculation. > > You are missing a few orders of magnitude here; there are approx. 2 ** 64 > distinct floats. 2 ** 53 is the mantissa of regular floats. There are > 2**52 floats X where 1.0 <= X < 2.0. > The number of "normal" floats is 2 ** 64 - 2 ** 52 + 1.
Since we're being picky here: Don't you mean 2 ** 64 - 2 ** 54 + 1? :) -- Mark -- http://mail.python.org/mailman/listinfo/python-list