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: -- (:)
From: Maxence Guesdon <maxence.guesdon@i...>
Subject: Re: [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.

Sorry, i replied too fast and did not answer your question, since you don't want to catch stack_overflow but be warned about an overflow during the computation of mult.

I don't know how to do that.

Maxence Guesdon
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: