Returns the nth Fibonacci number.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static long Fibonacci(
int n
)
Public Shared Function Fibonacci (
n As Integer
) As Long
public:
static long long Fibonacci(
int n
)
static member Fibonacci :
n : int -> int64
Parameters
- n
- Type: SystemInt32
The index of the number in the Fibonacci
sequence.
Return Value
Type:
Int64A long integer that equals the
nth Fibonacci number.
The Fibonacci sequence is defined by the
initial values, F0= 0 and
F1= 1, and the recurrence relation
Fn+1= Fn +
Fn–1.
Reference