libqbe/tools/fptox.c

19 lines
287 B
C
Raw Normal View History

2016-02-03 15:50:55 -05:00
#include <stdio.h>
#include <stdlib.h>
int
main(int ac, char *av[])
{
double d;
float f;
if (ac < 2) {
usage:
fputs("usage: fptox NUMBER\n", stderr);
return 1;
}
f = d = strtod(av[1], 0);
2016-02-11 19:03:42 -05:00
printf("0x%08x 0x%016llx\n", *(unsigned *)&f, *(unsigned long long*)&d);
2016-02-03 15:50:55 -05:00
return 0;
}