From da640c5a467bfdf7b3bbced52fc13a28fd8b37bd Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 27 Mar 2016 18:17:08 -0400 Subject: move tools to the root --- tools/fptox.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tools/fptox.c (limited to 'tools/fptox.c') diff --git a/tools/fptox.c b/tools/fptox.c new file mode 100644 index 0000000..a2bc155 --- /dev/null +++ b/tools/fptox.c @@ -0,0 +1,18 @@ +#include +#include + +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); + printf("0x%08x 0x%016llx\n", *(unsigned *)&f, *(unsigned long long*)&d); + return 0; +} -- cgit 1.4.1