Last active
May 27, 2017 14:07
-
-
Save deque-blog/296a51860ff73d22e45c0c0172414b65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PerfFiboJava { | |
static public BigInteger fibs(int n) { | |
BigInteger curr = BigInteger.valueOf(0); | |
BigInteger next = BigInteger.valueOf(1); | |
for (; n > 0; --n) { | |
BigInteger nnext = curr.add(next); | |
curr = next; | |
next = nnext; | |
} | |
return curr; | |
} | |
} | |
(defn fibo-with-java | |
[^long n] | |
(PerfFiboJava/fibs n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment