Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - osadijfj43

Pages: [1]
1
Network / Safest way to send floats over sockets?
« on: April 12, 2009, 05:35:52 pm »
The SFML packet tutorial mentions problems that can arise from exchanging primitive types over sockets to different platforms.  As a solution, it mentions

Quote
... to use SFML's fixed size types : sf::Int8, sf::Uint16, sf::Int32, etc. Those types are guaranteed to have the intended size on any platform.


What is the safest way to avoid problems while sending floats (and doubles) over a socket?  Does the IEEE floating point standard define floats to be 32-bits and doubles to be 64-bits?  If so, are there any platforms that deviate from the standard that I (well, I suppose everyone) should be aware of?

Pages: [1]
anything