where the function has problem? n = 900 is OK , but n = 1000 is ERROR

Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9af6 at myhashismyemail.com
Tue Aug 2 09:16:59 EDT 2011


On 08/02/2011 08:45 AM, Alain Ketterlin wrote:
> produce integers. And it will fail with overflow for big values.

If it would make you feel better I can use decimal.

Also, perhaps I can name my function billy_fibo(n), which is defined as 
billy_fibo(n) +error(n) = fibo(n), where error(n) can be made 
arbitrarily small.  This runs in constant time rather than linear 
(memoized) or exponential (fully recursive) at the cost of a minutia of 
accuracy.  I find this tradeoff acceptable.

--
Bill



More information about the Python-list mailing list