10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-25 20:27:28 +02:00

Handle at_exit with Ctrl-C

This commit is contained in:
Anthony Scemama 2019-04-05 15:53:15 +02:00
parent ee98fbb33a
commit 11367c6ff7

View File

@ -5,7 +5,7 @@
open Constants
open Lacaml.D
let factmax = 150
external erf_float : float -> float = "erf_float_bytecode" "erf_float"
[@@unboxed] [@@noalloc]
@ -35,7 +35,16 @@ external leadz : int64 -> int32 = "leadz_bytecode" "leadz"
let leadz i = leadz i |> Int32.to_int
exception Ctrl_C
let () =
let f _ = raise Ctrl_C in
Sys.set_signal Sys.sigint (Sys.Signal_handle f)
;;
let factmax = 150
(* Incomplete gamma function : Int_0^x exp(-t) t^(a-1) dt
p: 1 / Gamma(a) * Int_0^x exp(-t) t^(a-1) dt