From: Richard J. <ri...@an...> - 2005-11-30 14:42:15
|
On Wed, Nov 30, 2005 at 01:45:03PM +0000, Mark White wrote: > I'd like to write some OCaml routines to read and write > large arrays from an (already defined) binary file format, > in several numeric types (big/little endian, short/long > ints, single/double prec floats). Is there a convenient way > to do this without resorting to writing a C module? > > 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) Does someone who understands single-precision floating point formats want to comment on whether this is possible in pure OCaml? Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com |