aboutsummaryrefslogtreecommitdiff
path: root/entries/alexanderjsummers/scala/Fib.scala
blob: bc25902204edf0bffefcad0775b2184c611d5d0e (plain) (blame)
1
2
3
4
5
6
7
object Fib {
  private val golden = (1 + Math.sqrt(5)) / 2;

  def next(i:Long) : Long = {
    Math.round(i.toDouble * golden)
  }
}