Skip to content

Instantly share code, notes, and snippets.

@jhorneman
Created June 24, 2014 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhorneman/b64c92f8d781555be7b9 to your computer and use it in GitHub Desktop.
Save jhorneman/b64c92f8d781555be7b9 to your computer and use it in GitHub Desktop.
rawBytesToFloat
float rawBytesToFloat(char* _buffer)
{
unsigned int rawValue = asio::detail::socket_ops::network_to_host_long(*((unsigned int*) (_buffer)));
return *(reinterpret_cast<float*>(&rawValue));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment