[Haskell-cafe] ANN: ieee version 0.7
John Millikin
jmillikin at gmail.com
Mon Sep 20 00:31:00 EDT 2010
On Sun, Sep 19, 2010 at 20:16, Conrad Parker <conrad at metadecks.org> wrote:
> Anyway, good work. Does this have any overlap with
> data-binary-ieee754? There was some recent discussion here about the
> encoding speed in that package.
I should probably make it more clear that data-binary-ieee754 is for
special use cases; for most people, using something like this will be
much faster since it doesn't have to poke around the individual bits:
putFloat32be :: Float -> Put
putFloat32be = putWord32be . unsafeCoerce
I needed "real" IEEE754 binary support for round-trip parsing, where
(for example) maintaining the particular bit pattern of a NaN is
important. For 99% of people, the "unsafe" method will work fine.
More information about the Haskell-Cafe
mailing list