From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 48CCFBBAF for ; Tue, 5 Jan 2010 14:17:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuIAAC7KQkvRVdzjkWdsb2JhbACbHD8BAQEBCQsKBxMDiDGjAIVlhgcBAgMFhCsEiy4 X-IronPort-AV: E=Sophos;i="4.47,505,1257116400"; d="scan'208";a="40793751" Received: from mail-fx0-f227.google.com ([209.85.220.227]) by mail2-smtp-roc.national.inria.fr with ESMTP; 05 Jan 2010 14:17:02 +0100 Received: by fxm27 with SMTP id 27so1710843fxm.3 for ; Tue, 05 Jan 2010 05:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=xvXzzqfTosc99Yjb+e5qYVhYZd1mjBe5hL9TcIB0XAQ=; b=RwkDxOIaMNut2WZ/R49aYdjz99RV32E0U2nIhFFEHQBLAlsTh1FhQSrRsw3C2fnD9b C7bU2Jd+clIO6VaExsHHyBTOnnbOHe6Ua/cl2k1nOmcL5gdw8m9mO7slSxilxn7/UnFw v8JNvMQZ3rJrvk89tvz/VPJZE/gR8gU0bp4vI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XdFTmQVv+cKPsaYr9Kqyv9xWAnMJv19LSJcpRXVZ0IrtygDMDRgx+C6iSqCpFXehDX 2k4PEYHsqiwc6IkRwd84VW6D5N0gd5bVAo1yc8uMGbcoO/kEQnwU+uoRvfQYNDZYrtTd 8IplY20h4EaZCGHUO6RQlIHNUruyyy86fjkFs= MIME-Version: 1.0 Sender: oandrieu@gmail.com Received: by 10.223.2.199 with SMTP id 7mr7075757fak.107.1262697421459; Tue, 05 Jan 2010 05:17:01 -0800 (PST) In-Reply-To: <4B4337A0.8000603@fiit.stuba.sk> References: <4B4337A0.8000603@fiit.stuba.sk> Date: Tue, 5 Jan 2010 14:17:01 +0100 X-Google-Sender-Auth: 58c1c7ae12e84a35 Message-ID: <95513601001050517g5f65322au4e0bcce7374734eb@mail.gmail.com> Subject: Re: [Caml-list] 2147483648l < 2147483647l From: Olivier Andrieu To: Matej Kosik Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; andrieu:01 oandrieu:01 bool:01 bug:01 misfeature:01 lexer:01 parser:01 bug:01 wrote:01 integer:01 caml-list:01 nerim:01 int:01 int:01 caml:02 On Tue, Jan 5, 2010 at 13:59, Matej Kosik wrote: > Hello, > > I am sorry, I have a stupid question. > I would like to ask if this: > > =A0 =A0 =A0 =A0# 2147483648l < 2147483647l;; > =A0 =A0 =A0 =A0- : bool =3D true > > should not regarded as a bug. In my project I need Int32 value and above > behavior surprised me. Value > > =A0 =A0 =A0 =A02147483648l > > should not be allowed at all because it cannot be encoded to 32-bit > signed integer encoded with 2's complement representation. > > Thanks in advance for help. yes that's a "misfeature" of the lexer/parser. The point is that it accepts -2147483648l (representable as an int32) ; the downside is that it accepts 2147483648l and treats it as -1l. Cf. this bug report: http://caml.inria.fr/mantis/view.php?id=3D4210 . --=20 Olivier