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 AAA14233; Fri, 11 Oct 2002 00:17:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA14422 for ; Fri, 11 Oct 2002 00:17:16 +0200 (MET DST) Received: from yoda.planetinternet.be (anvers-smtp.planetinternet.be [195.95.30.152]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9AMHF509826; Fri, 11 Oct 2002 00:17:15 +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 56186374C7; Fri, 11 Oct 2002 00:17:14 +0200 (CEST) Message-ID: <021501c270aa$ca400660$0100a8c0@janxp> From: "Scott J," To: "Xavier Leroy" Cc: References: <00bd01c2706d$e7cd68e0$0100a8c0@janxp> <200210101521.RAA0000032708@beaune.inria.fr> <20021010181323.GA1922@iliana> <20021010205716.A8990@pauillac.inria.fr> Subject: Re: [Caml-list] Runtime overflow and what to do Date: Fri, 11 Oct 2002 00:17:15 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0211_01C270BB.8D9B0FA0" 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_0211_01C270BB.8D9B0FA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, So it is not easy, perhaps even impossible if the processor doesn't set a flag . e.g. fact n begins first with a lis of negative numbers (after overflow) then comes again a list with positive numbers and then it remains = 0 Scott ----- Original Message ----- From: Xavier Leroy To: Sven LUTHER Cc: Luc Maranget ; Scott J, ; caml-list@inria.fr Sent: Thursday, October 10, 2002 8:57 PM Subject: Re: [Caml-list] Runtime overflow and what to do > But it is the lower bit that is ignored, no, si i guess incrementing an > ocaml integer by 1, correspond to incrementing the machine integer by > two, and would set the overflow flag in the processor status register > all the same, would it not ? Yes, except that not all processors have overflow flags. The Alpha and the MIPS don't, for instance. Integer arithmetic modulo a power of 2 is unpleasant for certain applications (and very useful for others, e.g. hash functions and cryptography), but this is really all what today's processors offer. - Xavier Leroy ------=_NextPart_000_0211_01C270BB.8D9B0FA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
So it is not easy, perhaps even = impossible if the=20 processor doesn't set a flag .
 
e.g. fact n begins first with a lis of = negative=20 numbers (after overflow) then comes again a list with positive numbers = and then=20 it remains =3D 0
 
Scott
----- Original Message -----
From:=20 Xavier=20 Leroy
Cc: Luc Maranget ; Scott J,=20 ; caml-list@inria.fr
Sent: Thursday, October 10, = 2002 8:57=20 PM
Subject: Re: [Caml-list] = Runtime overflow=20 and what to do

> But it is the lower bit that is ignored, no, si i = guess=20 incrementing an
> ocaml integer by 1, correspond to incrementing = the=20 machine integer by
> two, and would set the overflow flag in the = processor status register
> all the same, would it not ? =

Yes,=20 except that not all processors have overflow flags.  The = Alpha
and the=20 MIPS don't, for instance.  Integer arithmetic modulo a = power
of 2 is=20 unpleasant for certain applications (and very useful for
others, = e.g. hash=20 functions and cryptography), but this is really all
what today's = processors=20 offer.

- Xavier Leroy ------=_NextPart_000_0211_01C270BB.8D9B0FA0-- ------------------- 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