From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A160ABC84 for ; Thu, 24 Mar 2005 21:20:35 +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 j2OKKZnX029123 for ; Thu, 24 Mar 2005 21:20:35 +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 VAA16923 for ; Thu, 24 Mar 2005 21:20:34 +0100 (MET) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.79]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2OKKYnZ029116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 24 Mar 2005 21:20:34 +0100 Received: from [192.168.144.2] (unknown [84.4.35.94]) by smtp.cegetel.net (Postfix) with ESMTP id ED62067168; Thu, 24 Mar 2005 21:20:33 +0100 (CET) Message-ID: <42432108.2040801@univ-savoie.fr> Date: Thu, 24 Mar 2005 21:20:24 +0100 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050322 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list Subject: float printing X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig00B8EB70320296AF16D90AAA" Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 42432113.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42432112.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 printf:01 pervasives:01 pervasives:01 chablais:01 73376:01 univ-savoie:01 lama:01 mutt:01 rfc:02 universite:03 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig00B8EB70320296AF16D90AAA Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit I have a small problem to read and write float in a file. I use the format library and there is no way to write/read a float in hexadecimal to be sure you read exactly the same float back from the file (a n bits mantisse float may need n decimals to have an exact representation. Just compute 1/2^n and count decimals). The only way is to convert the float to string via Printf and then print the string with Format.print_string. Don't you think Pervasives and format should have a write/print_hexfloat and Pervasives should have an input_hexfloat function ? -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- --------------enig00B8EB70320296AF16D90AAA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFCQyEISQDyWB/+xBwRAvnjAKCPRVzb5ue+U/f1YI0n4ugFmO8TOgCg3qVK 7LBZ1o2AUtvkA4wkOO0YVlQ= =PjU0 -----END PGP SIGNATURE----- --------------enig00B8EB70320296AF16D90AAA--