Fibonacci sequence: Difference between revisions
Content deleted Content added
Keithpinson (talk | contribs) |
Keithpinson (talk | contribs) |
||
Line 3,881:
===foldLeft===
<lang scala>// Fibonacci using BigInt with Stream.foldLeft optimized for GC (Scala v2.9 and above)
// Does not run out of memory for very large Fibonacci numbers
def fib(n:Int) = {
|