Skip to content

scottmacphersonmusic/fibonacci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fibonacci

by Scott Macpherson

Description

fibonacci is a simple application that calculates the Fibonacci sequence.

Usage

First, new up an insance of the Fibonacci class:

fib = Fibonacci.new

There is only one method available, but you can use it two different ways.

To calculate the value of the nth element of the Fibonacci sequence pass nth_element an integer argument:

fib.nth_element(8) => 13

To see how many places the algorithm can calculate the sequence to in 10 seconds don't pass in any arguments:

fib.nth_element => Computed 267098 places in 10 seconds.

(you will need to wait 10 seconds)

Credit

Amy Kang contributed to the algorithm design.

Kevin Townsend helped with testing.

I learned how to express infinity in ruby at https://stackoverflow.com/questions/5778295/how-to-express-infinity-in-ruby

I edited the markdown for this README at https://dillinger.io/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages