diff options
Diffstat (limited to 'entries')
-rw-r--r-- | entries/alexanderjsummers/scala/Fib.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/entries/alexanderjsummers/scala/Fib.scala b/entries/alexanderjsummers/scala/Fib.scala new file mode 100644 index 0000000..bc25902 --- /dev/null +++ b/entries/alexanderjsummers/scala/Fib.scala @@ -0,0 +1,7 @@ +object Fib {
+ private val golden = (1 + Math.sqrt(5)) / 2;
+
+ def next(i:Long) : Long = {
+ Math.round(i.toDouble * golden)
+ }
+}
\ No newline at end of file |