[SDL] Floating data types...

Mattias Engdegård f91-men at nada.kth.se
Wed Jan 24 01:15:06 PST 2001


>   Are floating(double and long double too) data types the same on all
>platforms? That is do they all have the same mantissa, exponent,
>endianess... I noticed SDL_net doesn't have any conversion methods for
>sending floats to machines of different endianess.

2 issues: byte order and fp format. Most contemporary machines use
IEEE floats so you can safely spec that in a protocol. Use either 32
or 64 bit floats; oddball ones like 80 (intel) or 128 (sun) are out,
so are ancient stuff like ibm 360/VAX/Cray fp formats. You can
probably use the ordinary byte order macros to convert endianness ---
this is not guaranteed but true in reality




More information about the SDL mailing list