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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 3FFA1BC0B for ; Fri, 8 Dec 2006 18:50:49 +0100 (CET) Received: from pih-relay06.plus.net (pih-relay06.plus.net [212.159.14.133]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kB8Hompt008258 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 8 Dec 2006 18:50:49 +0100 Received: from [80.229.56.224] (helo=[10.0.0.5]) by pih-relay06.plus.net with esmtp (Exim) id 1Gsjrx-0003bV-UV for caml-list@yquem.inria.fr; Fri, 08 Dec 2006 17:50:46 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] if (n:int) < 0 then (-n) > 0 is FALSE Date: Fri, 8 Dec 2006 17:48:03 +0000 User-Agent: KMail/1.9.5 References: <45785E27.8050804@naughtydog.com> <200612071943.kB7JhC522308@virtutech.se> In-Reply-To: <200612071943.kB7JhC522308@virtutech.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200612081748.03288.jon@ffconsultancy.com> X-Miltered: at discorde with ID 4579A5F8.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mattias:01 bug:01 bug:01 unboxed:01 bignum:01 unboxed:01 bignum:01 ocaml:01 frog:98 wrote:01 overflows:01 slower:01 integer:01 caml-list:01 functions:01 On Thursday 07 December 2006 19:43, Mattias Engdeg=E5rd wrote: > Of course it is a bug I wouldn't call it a bug. It looks like modulo arithmetic to me. > I would love to have a fast unboxed integer type that automatically > overflows to bignum, but it would be a tad slower than the current "int". How can it be both unboxed and allow overflow to a bignum? Would you genera= te=20 int and bigint versions of all functions and then bail to the bigint versio= n=20 if anything overflowed? =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists