<-- Previous || Up || Next -->

Fibonacci Function
Math Arithmetic Class

Public Function Fibonacci( _
    ByVal vX As Variant _
    ) As Variant

Return the Nth Fibonacci number as specified in vX.
Every Fibnonacci number is the sum of the previous two numbers in the sequence, except for the first two numbers which are both 1 (one).
vX must be between 1 and 1476.

Examples:
    Fibonacci(0) = 0
    Fibonacci(1) = 1
    Fibonacci(2) = 1
    Fibonacci(3) = 2
    Fibonacci(4) = 3
    Fibonacci(5) = 5
    Fibonacci(6) = 8
    Fibonacci(7) = 13
See also:
    FibonacciComplex Function
vX: The sequence number of the Fibonacci number to be returned. Function returns Null if vX is Null of cannot be fixed up to a number.

Function returns 0 (zero) if vX is < 1 (less than one).

Function returns Null if vX is greater than 1476.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.