aboutsummaryrefslogtreecommitdiff
path: root/entries/alexanderjsummers
diff options
context:
space:
mode:
authorbraxtonhall2022-10-27 06:25:40 +0000
committerbraxtonhall2022-10-27 06:25:40 +0000
commit19db075fb5c22e8a454cc9e8b3e07aff9355ef9c (patch)
treecfefbeb20d17343af3250532e2e784efb846ce9d /entries/alexanderjsummers
parent27b827cae18ec64e22de14379758fdf33f703fcd (diff)
Add Alex
Diffstat (limited to 'entries/alexanderjsummers')
-rw-r--r--entries/alexanderjsummers/scala/Fib.scala7
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