Game Maker Games, Articles, Tutorials & More

Game Maker Network


Howdy, Guest! Please sign in or register an account.

Print

fibonacci

By Daniel · January 1, 2009

Computes the n'th number in the fibonacci sequence. This is faster than the iterative method, but loses precision more quickly, making it accurate up to n=75.

/* fibonacci(n)
 *
 * Computes the n'th number in the fibonacci sequence.
 *
 * This is faster than the iterative method, but loses precision more quickly,
 * making it accurate up to n=75.
 */

return round(power((1 + sqrt(5)) / 2, argument0) / sqrt(5));

Categories: Mathematics

Comments

There are no comments to display.

Post a Comment

You must be signed in to post comments.

Advertisement