public class Fibonacci extends Object implements Sequence
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Constructor and Description |
---|
Fibonacci(int length)
Construct a Fibonacci sequence.
|
Modifier and Type | Method and Description |
---|---|
double |
get(int i)
Get the i-th entry in the sequence, counting from 1.
|
double[] |
getAll()
Get a copy of the whole (finite) sequence in
double[] . |
int |
length()
Get the number of computed terms in the sequence.
|
public Fibonacci(int length)
length
- the number of terms to generateCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.