From: Mark W. <mj...@ce...> - 2005-11-30 16:52:26
|
Richard Jones writes: > On Wed, Nov 30, 2005 at 01:45:03PM +0000, Mark White wrote: > > I've found the IO module in ocaml-lib, which is quite > > helpful; biggest issue it doesn't seem to read/write > > single-precision IEEE floats. I'd be perfectly happy to > > use doubles internally and convert them at the IO stage. > > This looks like an omission from extlib which ought to be fixed. I've > just checked and it doesn't exist in CVS either. > > (X-posted to the extlib development list) Ok, sure -- a read_single there would make sense. > Does someone who understands single-precision floating point formats > want to comment on whether this is possible in pure OCaml? I've just noticed a work-around using the Int32 module: Int32.float_of_bits (IO.read_real_i32 ip) which seems to do the right thing. Thanks, Mark <>< |