summaryrefslogtreecommitdiff
path: root/support/dktools/test-sqdbl.c
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/test-sqdbl.c
Initial commit
Diffstat (limited to 'support/dktools/test-sqdbl.c')
-rw-r--r--support/dktools/test-sqdbl.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/support/dktools/test-sqdbl.c b/support/dktools/test-sqdbl.c
new file mode 100644
index 0000000000..2f307a1aad
--- /dev/null
+++ b/support/dktools/test-sqdbl.c
@@ -0,0 +1,51 @@
+/*
+ WARNING: This file was generated by dkct.
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: test-sqdbl.ctr
+*/
+
+/** @file test-sqdbl.c The test-sqdbl module.
+*/
+
+
+#line 1 "test-sqdbl.ctr"
+
+#include "dk4conf.h"
+#include "dk4types.h"
+
+#include <stdio.h>
+#include <math.h>
+
+#include "dk4str8.h"
+
+
+
+
+
+#line 13 "test-sqdbl.ctr"
+
+
+
+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;
+}
+