Find limit of recursion: Difference between revisions

→‎{{header|OCaml}}: make it more readable with some indentation
(add gnuplot)
(→‎{{header|OCaml}}: make it more readable with some indentation)
Line 993:
<lang ocaml>(* One can build a function from the idea above, catching the exception *)
 
let rec_limit () = let last = ref 0 in
let rec f i =let last := i; 1 + f (i +ref 1)0 in
let rec f i =
try (f 0) with Stack_overflow -> !last;;
last := i;
1 + f (i + 1)
in
try (f 0)
try (f 0) with Stack_overflow -> !last;;
;;
 
rec_limit ();;