A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-October/069132.html below:

[Python-Dev] Caching float(0.0)

[Python-Dev] Caching float(0.0) [Python-Dev] Caching float(0.0)Tim Hochberg tim.hochberg at ieee.org
Mon Oct 2 19:43:51 CEST 2006
skip at pobox.com wrote:\/
>     Steve> By these statistics I think the answer to the original question
>     Steve> is clearly "no" in the general case.
> 
> As someone else (Guido?) pointed out, the literal case isn't all that
> interesting.  I modified floatobject.c to track a few interesting
> floating point values:
> 
[...code...]
> 
> So for a largely non-floating point "application", a fair number of floats
> are allocated, a bit over 25% of them are -1.0, 0.0 or +1.0, and nearly 50%
> of them are whole numbers between -10.0 and 10.0, inclusive.
> 
> Seems like it at least deserves a serious look.  It would be nice to have
> the numeric crowd contribute to this subject as well.

As a representative of the numeric crowd, I'll say that I've never 
noticed this to be a problem. I suspect that it's a non issue since we 
generally store our numbers in arrays, not big piles of Python floats, 
so there's no opportunity for identical floats to pile up.

-tim

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4