Re: Structure size and binary format



Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxx> writes:
[...]
> Text has a few pitfalls of its own. Even without appealing
> to the multitude of character encoding schemes, some difficulties
> are apparent. For example, it is no simple matter to devise a
> portable text representation for arbitrary `double' values. A
> value encoded as text, sent to another machine and decoded, then
> re-encoded and sent back again may not decode to the same value
> that was originally transmitted. It requires as much care to
> make this work for text as for binary representations. (And I've
> got the war stories from a PPOE to prove it, too ...)

A hexadecimal floating-point representation (supported in C99,
implementable in C90) should avoid at least some of the problems.
With enough digits, you can have an exact textual representation of a
floating-point value.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.