calcFib {PBSmodelling}R Documentation

Several Methods to Calculate Fibonacci Numbers

Description

Computes Fibonacci numbers using four different methods: 1) iteratively using R code, 2) via the closed function in R code, 3) iteratively in C using the .C function, and 4) iteratively in C using the .Call function.

Usage

calcFib(n, len=1, method="C")

Arguments

n nth fibonacci number to calculate
len A vector of length len showing previous fibonacci numbers
method Select method to use: C, Call, R, closed

Value

Vector of the last len Fibonacci numbers calculated.


[Package PBSmodelling version 0.60 Index]