From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- support/dktools/test-sqdbl.ctr | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 support/dktools/test-sqdbl.ctr (limited to 'support/dktools/test-sqdbl.ctr') diff --git a/support/dktools/test-sqdbl.ctr b/support/dktools/test-sqdbl.ctr new file mode 100644 index 0000000000..6ec065e36f --- /dev/null +++ b/support/dktools/test-sqdbl.ctr @@ -0,0 +1,37 @@ + +#include "dk4conf.h" +#include "dk4types.h" + +#include +#include + +#include "dk4str8.h" + + + +$!trace-include + + + +int main(void) +{ + char buf[64]; + double v; + int i; + + v = 5.555 / 1000000.0; + for (i = 0; i < 12; i++) { + if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 0, NULL)) { + fputs(buf, stdout); + fputc('\n', stdout); + } + if (0 != dk4str8_double_to_string(buf, sizeof(buf), v, 1, NULL)) { + fputs(buf, stdout); + fputc('\n', stdout); + } + v = 10.0 * v; + fputc('\n', stdout); + } + return 0; +} + -- cgit v1.2.3