Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Runtime overflow and what to do
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-10 (15:01)
From: Scott J, <jscott@p...>
Subject: [Caml-list] Runtime overflow and what to do

suppose I use the following code for fact

let rec fact n = if n <= 1 then 1 else n * fact (n - 1) ;;

Because an integer number is represented by a fixed number of bytes I will
get a runtime overflow if n is chosen too large.

Is there in Ocamel a workaround to cope with this problem . Something like "
Onoverflow goto .. " in imperative languages.