Re: Fibonacci implementation
- From: Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 01:39:31 GMT
Richard Heathfield wrote:
gw7rib@xxxxxxx said:
<snip>If you want single, large values however it
might be quicker to calculate them directly, as follows:
FUNCTION fib (k)
r = (1 + SQR(5)) / 2
t = 1 - r
fib = (r ^ k - t ^ k) / (r - t)
END FUNCTION
Oops. That was what I intended to offer the OP. I appear to have given him Stirling's Approximation for factorials instead.
Oh, I hate it when I mean to give someone a direct method for
calculating the N-th Fibonacci number and accidentally give them
Stirling's Approximation for factorials by mistake! And I am
always making that mistake, too...
- Logan
.
- References:
- Fibonacci implementation
- From: Christian Christmann
- Re: Fibonacci implementation
- From: gw7rib
- Re: Fibonacci implementation
- From: Richard Heathfield
- Fibonacci implementation
- Prev by Date: Re: TextBox array in ASP
- Next by Date: Script Parser
- Previous by thread: Re: Fibonacci implementation
- Next by thread: Re: Fibonacci implementation
- Index(es):