Fibonacci sequence: Difference between revisions

Content deleted Content added
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 (Scala v2.9 and above)
def fib(n:Int) = {