numpy NaN, not surviving pickle/unpickle?

Mark Dickinson dickinsm at gmail.com
Tue Sep 15 03:47:00 EDT 2009


On Sep 14, 4:05 pm, Scott David Daniels <Scott.Dani... at 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



More information about the Python-list mailing list