
Anything that guarantees a round trip MUST be a good.
(Getting output and input right would be even better! There are papers which present methods for doing it which claim to be proven correct - but these are not the methods used for popular implmentations.)
Is a hex fully portable? It surely just promises to be as close as the FP representation will allow? Or should we store the FP representation in the serialization and only deserialize if it matches exactly? This sounds a prudent move to me.
Um, what do you mean by fully portable? It is in the sense that: * If you do a write-then-read cycle on the same machine you get back exactly the same result. * If you do a write-then-read cycle on different machines you only get the same result back if the machine reading the value has at least as many bits in it's mantissa as the machine used for writing. But that goes without saying really. I guess I really should put my money where my mouth is and present some sample code, I'll see what I can do later.... John.