Re: Structure size and binary format
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Sat, 31 Dec 2005 19:08:37 GMT
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.
.
- References:
- Structure size and binary format
- From: gamehack
- Re: Structure size and binary format
- From: Chuck F.
- Re: Structure size and binary format
- From: Eric Sosman
- Structure size and binary format
- Prev by Date: Re: How to understand this line of c ?
- Next by Date: Re: How to understand this line of c ?
- Previous by thread: Re: Structure size and binary format
- Next by thread: Re: Structure size and binary format
- Index(es):