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 SAA18856; Thu, 30 Oct 2003 18:37:52 +0100 (MET) 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 SAA18845 for ; Thu, 30 Oct 2003 18:37:50 +0100 (MET) Received: from flyingtuxman.baretta.com ([213.255.109.130]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9UHbn118754 for ; Thu, 30 Oct 2003 18:37:50 +0100 (MET) Received: from baretta.com (flyingtuxman.baretta.com [127.0.0.1]) by flyingtuxman.baretta.com (8.12.8/8.12.8) with ESMTP id h9UHbGpv001544; Thu, 30 Oct 2003 18:37:21 +0100 Message-ID: <3FA14C4C.2010608@baretta.com> Date: Thu, 30 Oct 2003 18:37:16 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Marcin 'Qrczak' Kowalczyk" , Ocaml Subject: Re: [Caml-list] Int overflow in literals References: <1067522012.5880.6.camel@qrnik> In-Reply-To: <1067522012.5880.6.camel@qrnik> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 marcin:01 'qrczak':01 kowalczyk:01 compiler:01 imho:01 alex:01 alex:01 bytecode:01 int:01 int:01 arithmetic:01 toplevel:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Marcin 'Qrczak' Kowalczyk wrote: > I understand that int overflow is not checked on arithmetic for > efficiency reasons, but IMHO it would be better if it was checked > at least in literals. When someone writes 10000000000, he certainly > does not mean -737418240. > > It caused confusion in a class when someone was interactively testing > a function with larger and larger inputs. > I bet the official answer is "It's can't be done because native integers are 31 bits on 32 bit platforms, 63 bits on 64 bit platforms, so what is parser supposed to do? Especially in the case of the bytecode compiler." Although, I suppose something could be done in the toplevel. Alex ------------------- 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