mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 12:23:31 +01:00
Handle at_exit with Ctrl-C
This commit is contained in:
parent
ee98fbb33a
commit
11367c6ff7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user