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 UAA23629; Thu, 30 Oct 2003 20:56:17 +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 UAA23618 for ; Thu, 30 Oct 2003 20:56:16 +0100 (MET) Received: from pop9.ucdavis.edu (pop9.ucdavis.edu [169.237.105.19]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9UJuE123227 for ; Thu, 30 Oct 2003 20:56:14 +0100 (MET) Received: from beech (beech.ucdavis.edu [128.120.141.134]) by pop9.ucdavis.edu (8.12.9/8.12.9/it-std-5.0.2) with ESMTP id h9UJuCEV004610; Thu, 30 Oct 2003 11:56:12 -0800 (PST) Received: from ijtrotts by beech with local (Exim 3.36 #1 (Debian)) id 1AFJ2l-000532-00; Thu, 30 Oct 2003 12:05:19 -0800 Date: Thu, 30 Oct 2003 12:05:19 -0800 From: Issac Trotts To: "Marcin 'Qrczak' Kowalczyk" Cc: OCaml Mailing List Subject: Re: [Caml-list] Int overflow in literals Message-ID: <20031030200519.GA19324@ucdavis.edu> Reply-To: ijtrotts@ucdavis.edu References: <1067522012.5880.6.camel@qrnik> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1067522012.5880.6.camel@qrnik> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; issac:01 trotts:01 ijtrotts:01 caml-list:01 marcin:01 'qrczak':01 kowalczyk:01 issac:01 imho:01 int:01 int:01 arithmetic:01 writes:01 overflow:02 overflow:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Oct 30, 2003 at 02:53:32PM +0100, 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. If you want to be sure that the number is correctly stored, you can use Int64: Int64.of_string "10000000000" Issac -- ------------------- 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