summaryrefslogtreecommitdiff
path: root/support/dktools/test-sqdbl.ctr
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.ctr
Initial commit
Diffstat (limited to 'support/dktools/test-sqdbl.ctr')
-rw-r--r--support/dktools/test-sqdbl.ctr37
1 files changed, 37 insertions, 0 deletions
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 <stdio.h>
+#include <math.h>
+
+#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;
+}
+