Skip to content

Instantly share code, notes, and snippets.

@JamesMenetrey
Last active April 7, 2019 16:30
Show Gist options
  • Save JamesMenetrey/30880f5237e803afa64d595af42d2284 to your computer and use it in GitHub Desktop.
Save JamesMenetrey/30880f5237e803afa64d595af42d2284 to your computer and use it in GitHub Desktop.
C - quick and dirty hex to double
// Use the online compiler: https://www.onlinegdb.com/online_c_compiler
#include <stdio.h>
int main()
{
char v[] = {00, 00, 0xd8, 0x0a, 0x9b, 0x5f, 0x53, 0x42};
double* d_ptr = &v;
printf("%lf", *d_ptr);
return 0;
}
//print: 332833500000.000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment