Created
August 29, 2011 00:44
-
-
Save dmjio/1177471 to your computer and use it in GitHub Desktop.
Calculating all factorials of numbers 1 to 51,000
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
open System | |
open System.Diagnostics | |
let rec fac x = if x < 1.0 then 1.0 else x * fac(x-1.0) | |
let watch = new Stopwatch() | |
watch.Start() | |
let simpleComputation = [for i in 0.0..51000.0 -> fac(i)] | |
watch.Stop() | |
let result = watch.Elapsed.Seconds.ToString() | |
printfn "%s" result;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment