[Haskell-cafe] Just for a laugh...
Jules Bean
jules at jellybean.co.uk
Fri Jun 1 07:02:33 EDT 2007
Donald Bruce Stewart wrote:
> > let s = encode (1.1 :: Float)
> > :t s
> s :: Data.ByteString.Lazy.ByteString
> > s
> LPS ["\NUL\NUL\140\204\205\255\255\255\255\255\255\255\233"]
>
> > decode s :: Float
> 1.1
But doesn't Data.Binary serialise to a guaranteed representation, i.e.
machine-independent? Whereas this (stupid) question explicitly asked for
*your particular hardware's* floating point rep.
Jules
More information about the Haskell-Cafe
mailing list