-
-
Save JamesMenetrey/30880f5237e803afa64d595af42d2284 to your computer and use it in GitHub Desktop.
C - quick and dirty hex to double
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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