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 SAA04051; Fri, 2 Aug 2002 18:58:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA03842 for ; Fri, 2 Aug 2002 18:58:06 +0200 (MET DST) Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g72Gw5f22547 for ; Fri, 2 Aug 2002 18:58:05 +0200 (MET DST) Received: from user-0ccegbj.cable.mindspring.com ([24.199.65.115] helo=cs.cornell.edu) by snipe.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17afkZ-0006O9-00; Fri, 02 Aug 2002 09:58:03 -0700 Message-ID: <3D4ABA1A.3070707@cs.cornell.edu> Date: Fri, 02 Aug 2002 12:58:02 -0400 From: "Yaron M. Minsky" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020606 X-Accept-Language: en-us, en MIME-Version: 1.0 To: polux moon CC: caml-list@inria.fr Subject: Re: [Caml-list] read a float(double) in a file in a binary file References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Use the Int64 function bits_of_float to get the int64 representation of the float. Then using some arithmetic, extract the bytes and write them out in the order of your choosing. To read, you do the same thing in the opposite direction. y polux moon wrote: > > Hello > > How can I read a float (double) in a binary format (output of a programe > in c ) from a file ? > I ve done it for it (read four byte and do some arithmetic) but for > float i don t know how to do > > Thanks > > > _________________________________________________________________ > Rejoignez MSN Hotmail, le plus important service de messagerie > http://www.hotmail.com/fr > ------------------- > 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 ------------------- 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