From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 6DE90BBAF for ; Tue, 19 Jan 2010 18:59:57 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicCALKBVUvZSMDdkWdsb2JhbACBRpo5AQEBAQkLCgcTA7tshDME X-IronPort-AV: E=Sophos;i="4.49,305,1262559600"; d="scan'208";a="54317462" Received: from fmmailgate01.web.de ([217.72.192.221]) by mail4-smtp-sop.national.inria.fr with ESMTP; 19 Jan 2010 18:59:57 +0100 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id 5C6C51453FE6E; Tue, 19 Jan 2010 18:59:56 +0100 (CET) Received: from [95.208.117.111] (helo=frosties.localdomain) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1NXIMt-0000KK-00; Tue, 19 Jan 2010 18:59:56 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.69) (envelope-from ) id 1NXIMq-0006Am-S6; Tue, 19 Jan 2010 18:59:52 +0100 From: Goswin von Brederlow To: "David Allsopp" Cc: "OCaml List" Subject: Re: [Caml-list] 2147483648l < 2147483647l References: <4B4337A0.8000603@fiit.stuba.sk> <000101ca8e0a$aa006450$fe012cf0$@romulus.metastack.com> Date: Tue, 19 Jan 2010 18:59:51 +0100 In-Reply-To: <000101ca8e0a$aa006450$fe012cf0$@romulus.metastack.com> (David Allsopp's message of "Tue, 5 Jan 2010 13:26:16 -0000") Message-ID: <87ska2gelk.fsf@frosties.localdomain> User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.22 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1/dNffit3yWx10qjm/YSL/l2Oo8ZgkomGv8duUE pJrdk8WHwTGujBLWwsilrAcQ0B0NEfpztKCQDc26RDjwMKkB5e DGUZiFMUQ= X-Spam: no; 0.00; bool:01 bug:01 ocaml:01 parser:01 compiler:01 mfg:98 wrote:01 ints:01 caml-list:01 int:01 writes:01 behaviour:01 silently:02 overflow:03 docs:07 "David Allsopp" writes: > Matej Kosik wrote: >> I am sorry, I have a stupid question. >> I would like to ask if this: >> >> # 2147483648l < 2147483647l;; >> - : bool = true > > The bug is in fact: > > # 2147483648l;; > - : int32 = -2147483648l > > and given that behaviour, the above result makes sense! But... Isn't that documented properly? I think in the docs I saw at least that ocaml will silently overflow ints. But yeah, the parser/compiler should really warn when that happens. MfG Goswin