10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 14:43:41 +01: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 Constants
open Lacaml.D open Lacaml.D
let factmax = 150
external erf_float : float -> float = "erf_float_bytecode" "erf_float" external erf_float : float -> float = "erf_float_bytecode" "erf_float"
[@@unboxed] [@@noalloc] [@@unboxed] [@@noalloc]
@ -35,7 +35,16 @@ external leadz : int64 -> int32 = "leadz_bytecode" "leadz"
let leadz i = leadz i |> Int32.to_int 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 (* 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 p: 1 / Gamma(a) * Int_0^x exp(-t) t^(a-1) dt