Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] read a float(double) in a file in a binary file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Yaron M. Minsky <yminsky@C...>
Subject: Re: [Caml-list] read a float(double) in a file in a binary file
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