Fib

scalation.Fib
object Fib

The Fib object provides a method for computing Fibonacci numbers.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Fib.type

Members list

Value members

Concrete methods

def fib(n: Long): Long

Compute the n-th Fibonacci number, e.g., f(4) = f(3) + f(2) = 2 + 1 = 3. It uses the Naive Approach, see link for more efficient approaches.

Compute the n-th Fibonacci number, e.g., f(4) = f(3) + f(2) = 2 + 1 = 3. It uses the Naive Approach, see link for more efficient approaches.

Value parameters

n

the number to compute (for n >= 0)

Attributes

See also
def min(a: Array[Int], i: Int): Int