From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA02477; Thu, 10 Oct 2002 17:01:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA02747 for ; Thu, 10 Oct 2002 17:01:27 +0200 (MET DST) Received: from yoda.planetinternet.be (anvers-smtp.planetinternet.be [195.95.30.152]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9AF1QD00647 for ; Thu, 10 Oct 2002 17:01:26 +0200 (MET DST) Received: from janxp (u212-239-205-3.adsl.pi.be [212.239.205.3]) by yoda.planetinternet.be (Postfix) with ESMTP id A6F1E37629 for ; Thu, 10 Oct 2002 17:01:25 +0200 (CEST) Message-ID: <00bd01c2706d$e7cd68e0$0100a8c0@janxp> From: "Scott J," To: Subject: [Caml-list] Runtime overflow and what to do Date: Thu, 10 Oct 2002 17:01:26 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00B9_01C2707E.AB3199E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_00B9_01C2707E.AB3199E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, 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. Thx Scott ------=_NextPart_000_00B9_01C2707E.AB3199E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
 
suppose I use the following code for=20 fact
 
let rec fact n =3D if n <=3D 1 then = 1 else n * fact=20 (n - 1) ;;
 
Because an integer number is = represented by a fixed=20 number of bytes I will get a runtime overflow if n is chosen too=20 large.
 
Is there in Ocamel a workaround to cope = with this=20 problem . Something like " Onoverflow goto .. " in imperative=20 languages.
 
Thx
 
Scott
 
 
------=_NextPart_000_00B9_01C2707E.AB3199E0-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners