Created
October 23, 2016 18:38
-
-
Save cezarypiatek/9f99d5f73b9948a2cba94249206435e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bigFactorial n= | |
let rec loop x acc = | |
match x with | |
| x when x = 0I || x= 1I -> acc | |
| _ -> loop (x-1I) (acc*(x-1I)) | |
loop n 1I | |
[<EntryPoint>] | |
let main argv = | |
let timer = System.Diagnostics.Stopwatch() | |
timer.Start() | |
let result = (bigFactorial 100000I) | |
timer.Stop() | |
printfn "%A in %dms" result timer.ElapsedMilliseconds | |
System.Console.ReadKey() |> ignore | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment