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 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 EC7E5BC68 for ; Mon, 16 Oct 2006 22:19:54 +0200 (CEST) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9GKJoZw027671 for ; Mon, 16 Oct 2006 22:19:54 +0200 Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id 9B598DB4226; Mon, 16 Oct 2006 16:19:42 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by db2.internal (MEProxy); Mon, 16 Oct 2006 16:19:45 -0400 X-Sasl-enc: gADJCpMFzGX7HVdd7GoT59KiS4L7DpsIYiKJHzsR02aX 1161029984 Received: from adsl-75-18-118-29.dsl.sndg02.sbcglobal.net (adsl-75-18-118-29.dsl.sndg02.sbcglobal.net [75.18.118.29]) by mail.messagingengine.com (Postfix) with ESMTP id 45C902F58; Mon, 16 Oct 2006 16:19:44 -0400 (EDT) Date: Mon, 16 Oct 2006 13:19:40 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@droopy To: Maurizio Colucci Cc: caml-list Subject: Re: [Caml-list] Re: Reading 16 bit floats from stream? In-Reply-To: Message-ID: References: <1161016042.18038.2.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-j-chkmail-Score: MSGID : 4533E966.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 4533E966.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; logor:01 1977:98 2006,:98 wrote:01 caml-list:01 int:01 int:01 jambon:01 jambon:01 floats:02 bytes:03 bytes:03 float:03 predefined:03 stream:04 On Mon, 16 Oct 2006, Maurizio Colucci wrote: > I assume you mean four read_bytes calls... > > and make an int32 of >> them. > > > How do I create an int32 with four bytes? I can't recall any predefined function. You can read the bytes one by one, and use Int32.shift_left and Int32.logor to create the int32 value. > Then simply call Int32.float_of_bits. > > > I get this last one, but I can't imagine the previous step. > > Thanks > > Maurizio > -- Martin Jambon, PhD http://martin.jambon.free.fr