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

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Tue Aug 2 08:45:46 EDT 2011


Billy Mays
<81282ed9a88799d21e77957df2d84bd6514d9af6 at myhashismyemail.com> writes:

> On 08/01/2011 06:06 PM, Steven D'Aprano wrote:
>> Does your definition of "fixed" mean "gives wrong results for n>= 4 "?

> Well, I don't know if you're trolling or just dumb:

Steven is right, and you look dumb.

>>> fibo(4)
3.0000000000000004

Even though the math is correct, your program is wrong. It doesn't even
produce integers. And it will fail with overflow for big values.

-- Alain.



More information about the Python-list mailing list