From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id D826BBC0A for ; Wed, 4 Apr 2007 00:30:13 +0200 (CEST) Received: from server2.thinkcrime.de (server2.thinkcrime.de [213.133.110.149]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l33MUD6G005130 for ; Wed, 4 Apr 2007 00:30:13 +0200 Received: from hod-sarge-2005-10.lan.m-e-leypold.de (dslb-088-074-034-145.pools.arcor-ip.net [88.74.34.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server2.thinkcrime.de (Postfix) with ESMTP id 16BF6488176 for ; Wed, 4 Apr 2007 00:30:16 +0200 (CEST) Received: by hod-sarge-2005-10.lan.m-e-leypold.de (Postfix, from userid 1003) id 224F7376C9; Wed, 4 Apr 2007 00:37:17 +0200 (CEST) To: caml-list Subject: Re: [Caml-list] int_of_string bug References: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> <891bd3390703291826k6002ef28i93bca9944cdbceee@mail.gmail.com> <1175228631.18890.4.camel@rosella.wigram> <20070330155936.86654f51.mle+ocaml@mega-nerd.com> <4612941A.9010800@gmail.com> Organization: Leypold, Software-Dienstleistungen und -Beratung From: ls-ocaml-developer-2006@m-e-leypold.de Date: Wed, 04 Apr 2007 00:37:17 +0200 In-Reply-To: <4612941A.9010800@gmail.com> (Toby Kelsey's message of "Tue, 03 Apr 2007 18:51:22 +0100") Message-ID: User-Agent: Some cool user agent (SCUG) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at discorde with ID 4612D575.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 markus:01 mottl:01 arises:01 nativeint:01 markus:01 bug:01 val:01 bool:01 val:01 modular:01 wrote:01 integer:01 caml-list:01 writes:01 Toby Kelsey writes: > Markus Mottl wrote: > >> The problem is just shifted to bigger numbers. This problem arises >> with all integer conversion functions, i.e. Int64.of_string, >> Int32.of_string, Nativeint.of_string, int_of_string. >> Regards >> Markus > > This bug is not just a conversion problem: > > # let x = 1073741824;; > val x : int = -1073741824 > # (x < 0) && (x >= -x);; > - : bool = true # let x = - 1073741824;; val x : int = -1073741824 # -x;; - : int = -1073741824 But this is as specified for modular ints. No surprise here ... Regards -- Markus