tag:blogger.com,1999:blog-694679611587040520.post2628638876448139287..comments2024-01-31T01:51:20.717-08:00Comments on Carlos Quintanilla's blog: Factorial and Fibonacci in F#Carlos Quintanillahttp://www.blogger.com/profile/15415604076909500411noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-694679611587040520.post-26599082761134368492012-05-03T14:28:31.294-07:002012-05-03T14:28:31.294-07:00Thanks James,
I will definitively do something wi...Thanks James, <br />I will definitively do something with those examples. Maybe a new post once I finish with the Factorial and Fibonacci series (just 2 more)Carlos Quintanillahttps://www.blogger.com/profile/15415604076909500411noreply@blogger.comtag:blogger.com,1999:blog-694679611587040520.post-61667879908763912162012-04-24T17:35:51.416-07:002012-04-24T17:35:51.416-07:00You really should try Daniel's implementations...You really should try Daniel's implementations - your recursive forms are not tail recursive and this will drag down performance significantly.James Worldnoreply@blogger.comtag:blogger.com,1999:blog-694679611587040520.post-82530867849505766282011-03-07T00:31:30.411-08:002011-03-07T00:31:30.411-08:00Thanks Daniel
I will add a section with examples p...Thanks Daniel<br />I will add a section with examples people give in the comments to compare time and syntax.Carlos Quintanillahttps://www.blogger.com/profile/15415604076909500411noreply@blogger.comtag:blogger.com,1999:blog-694679611587040520.post-303153609837189172011-03-07T00:24:49.748-08:002011-03-07T00:24:49.748-08:00that factorial should be:
let factorial n = [1I ....that factorial should be:<br /><br />let factorial n = [1I .. (bigint n)] |> Seq.reduce ( * )Daniel Jacksonhttp://blog.thinkhard.netnoreply@blogger.comtag:blogger.com,1999:blog-694679611587040520.post-3194036095412105592011-03-07T00:22:04.630-08:002011-03-07T00:22:04.630-08:00let fibonacci = Seq.unfold (fun (x, y) -> Some(...let fibonacci = Seq.unfold (fun (x, y) -> Some(x, (y, x + y))) (0I,1I)<br /><br />let factorial n = let m = bigint n in [1 .. n] |> Seq.reduce ( * )Daniel Jacksonhttp://blog.thinkhard.netnoreply@blogger.com