From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id BAEE6BBBB for ; Sun, 19 Feb 2006 17:38:42 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1JGcgdq023369 for ; Sun, 19 Feb 2006 17:38:42 +0100 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 RAA31892 for ; Sun, 19 Feb 2006 17:38:41 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1JGces4023356 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 19 Feb 2006 17:38:41 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1FAra3-0000Hu-00 for ; Sun, 19 Feb 2006 16:38:39 +0000 Date: Sun, 19 Feb 2006 16:38:39 +0000 To: caml-list@inria.fr Subject: Re: [Caml-list] What library to use for arbitrary precision decimals Message-ID: <20060219163838.GA32465@furbychan.cocan.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at concorde with ID 43F89F12.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43F89F10.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 integers:01 ocaml:01 datatype:01 stdlib:01 tar:01 notepad:01 arbitrary:01 define:01 types:02 library:03 library:03 converted:04 docs:05 tmp:05 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Before we go too far down the currency track (where I agree, using integers is the way to go), my actual requirement is for a natural OCaml mapping for the PostgreSQL NUMERIC/DECIMAL type: http://www.postgresql.org/docs/current/interactive/datatype.html#DATATYPE-NUMERIC-DECIMAL The database can define types like NUMERIC(6,4) which means 6 decimal digits in total, 4 of them after the decimal point -- for example, 12.3456 There doesn't seem to me to be a good natural map for this type in the stdlib. Rich. PS. You can find latest progress on PG'OCaml here: http://merjis.com/tmp/pgocaml-0.3.tar.gz I've already converted a few of our bigger programs to use this library. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com