From 63ff2829f7c75e9c56c4e3529c2ae00df6fec08a Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 6 Dec 2015 14:51:58 -0500 Subject: [PATCH] portability tooling --- c/experimental/fltres.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 c/experimental/fltres.c diff --git a/c/experimental/fltres.c b/c/experimental/fltres.c new file mode 100644 index 000000000..621e61082 --- /dev/null +++ b/c/experimental/fltres.c @@ -0,0 +1,20 @@ +#include + +static void show(long long i) { + double d = (double) i; + long long j = (long long) d; + printf("%016llx %lld %lf %016llx\n", i, i, d, j); +} + +int main() { + show(0x7ffffffffffff9ff); + show(0x7ffffffffffffa00); + show(0x7ffffffffffffbff); + show(0x7ffffffffffffc00); + show(0x7ffffffffffffdff); + show(0x7ffffffffffffe00); + show(0x7ffffffffffffffe); + show(0x7fffffffffffffff); + + return 0; +}