Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active May 27, 2017 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/296a51860ff73d22e45c0c0172414b65 to your computer and use it in GitHub Desktop.
Save deque-blog/296a51860ff73d22e45c0c0172414b65 to your computer and use it in GitHub Desktop.
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