Tuesday, April 24, 2012

efficiency

These 61 characters compute a 20899-digit number in 1 second @ 1ghz.

main = print $ fibs !! 100000

fibs = 0 : scanl (+) 1 fibs

No comments:

Post a Comment