Mail Archives: djgpp/1994/07/29/21:17:51
> >
> > I have trouble reading binary floating point data (4bytes/value) from a
> > file generated on a sun/unix into my code compiled with djgpp.
>
> For starters, Suns are big-endian and i386 are little-endian, so
> binary formats in general (even integers) are not going to be
> compatible.
>
> Secondly, floating point binary formats aren't guaranteed to be the
> same across platforms.
>
> You're best bet is to convert the values to strings for file storage.
>
>
Agreed.
Take a good look at your applications and determine if you really
need floats... (often times 2**16 or 2**32 discrete values are
fine).
If you need to transport floats, use ascii strings. I don't
think ansi makes any guarantees on floating point formats...
marty
leisner AT sdsp DOT mc DOT xerox DOT com
Member of the League for Programming Freedom
"I just know I'm a better manager when I have Joe DiMaggio in center field" --
Casey Stengel
- Raw text -