[Python-Dev] Caching float(0.0)

Aahz aahz at pythoncraft.com
Mon Oct 2 18:51:30 CEST 2006


On Mon, Oct 02, 2006, "Martin v. L?wis" wrote:
> Michael Hudson schrieb:
>>
>> I think most of
>> the code posted so far has been constant time, at least in terms of
>> instruction count, though some might indeed be fairly slow on some
>> processors -- conversion from double to integer on the PowerPC
>> involves a trip off to memory for example.
> 
> Kristian's code testing only for integers in a range would be of
> that kind. Code that tests for a list of literals determined
> at compile time typically needs time "linear" with the number of
> special-cased constants (of course, as that there is a fixed
> number of constants, this is O(1)).

What if we do this work only on float()?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"LL YR VWL R BLNG T S"  -- www.nancybuttons.com


More information about the Python-Dev mailing list