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 VAA24371; Mon, 20 Jan 2003 21:58:38 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA24685 for ; Mon, 20 Jan 2003 21:58:38 +0100 (MET) Received: from mel-rto2.wanadoo.fr (smtp-out-2.wanadoo.fr [193.252.19.254]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0KKwbr09698 for ; Mon, 20 Jan 2003 21:58:37 +0100 (MET) Received: from mel-rta8.wanadoo.fr (193.252.19.79) by mel-rto2.wanadoo.fr (6.7.015) id 3E0C337000E9617E; Mon, 20 Jan 2003 21:58:22 +0100 Received: from iliana (80.13.236.113) by mel-rta8.wanadoo.fr (6.7.015) id 3E26DA7000281A1A; Mon, 20 Jan 2003 21:58:22 +0100 Received: from luther by iliana with local (Exim 3.36 #1 (Debian)) id 18aizt-0000oN-00; Mon, 20 Jan 2003 21:58:21 +0100 Date: Mon, 20 Jan 2003 21:58:20 +0100 To: Christoph Bauer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Need unsigned int Message-ID: <20030120205820.GA3051@iliana> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i From: Sven Luther Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Jan 20, 2003 at 08:05:38PM +0100, Christoph Bauer wrote: > Hi, > > my program need to calculate a hash key of a matrix (with dimension 8 > x 8). It is necessary that this calculation is very fast, so my > program will update the hash key after every small modification of the > matrix. My problem is that the hash key should be an unsigned int > or an unsigned long in. > > My problem occurs here (Mersenne prime number 2^31-1): > let big_prim = 2147483647 > val big_prim : int = -1 Solution #1 : buy yourself a 64bit box, and you will have integers upto 2^63-1 :))) Solution #2 : Use the Int64 module. Solution #3 : Use the ocaml bignum module. Friendly, Sven Luther ------------------- 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