Guest User

Untitled

a guest
Oct 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. let rec factorial(n : int) (mem : bigint) =
  2. match n with
  3. | 0 | 1 -> mem
  4. | _ -> factorial (n - 1) (mem * bigint(n))
  5.  
  6.  
  7. let BigFactorial(numero,mesaje)=
  8. Async.FromContinuations(fun (cont,error,cancelation) ->
  9. printfn "ha comenzado el proceso: %s" mesaje
  10. factorial numero 1I |>ignore
  11. printfn "ha terminado el proceso: %s ." mesaje
  12. cont())
  13.  
  14. Async.RunSynchronously(async{
  15. printfn "comenzando"
  16. do! BigFactorial(100000,"100 mil")
  17. do! BigFactorial(500, "500")
  18. printfn "fin..."
  19. })
Add Comment
Please, Sign In to add comment