Re: Fibonacci implementation
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 20:53:02 +0000
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.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.
- Follow-Ups:
- Re: Fibonacci implementation
- From: Logan Shaw
- Re: Fibonacci implementation
- References:
- Fibonacci implementation
- From: Christian Christmann
- Re: Fibonacci implementation
- From: gw7rib
- Fibonacci implementation
- Prev by Date: Re: How to compute triangle base/altitude intersection
- Next by Date: Re: cgi-script problem
- Previous by thread: Re: Fibonacci implementation
- Next by thread: Re: Fibonacci implementation
- Index(es):