
1 Jun
2007
1 Jun
'07
11:09 a.m.
jules:
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.
Ah right. Missed that. There was a long thread on the libraries@ mailing list on doing this (David Roundy suggested it, initially, iirc) a couple of months ago. Might be useful to read. -- Don