Java Fibonacci Sequence Get getFibonacciSeq(long f)

Here you can find the source of getFibonacciSeq(long f)

Description

get Fibonacci Seq

License

Open Source License

Declaration

public static int getFibonacciSeq(long f) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import static java.lang.Math.*;

public class Main {
    public static final double GOLDEN_RATIO = (1 + sqrt(5)) / 2;

    public static int getFibonacciSeq(long f) {
        return (int) Math.floor(Math.log(f * sqrt(5) + 0.5) / Math.log(GOLDEN_RATIO));
    }// w w  w . ja v a2 s  .com
}

Related

  1. fibonacci(int n)
  2. fibonacci(int n)
  3. fibonacci(int n)
  4. fibonacci(long max)
  5. getFibonacci(int number)
  6. getFibonnaci(long i)
  7. isFibonacci(long f)
  8. makeFibonacciSupplier()
  9. toFibonacciSumSequences(long i)