diff options
Diffstat (limited to 'support/dktools/test-sqdbl.ctr')
-rw-r--r-- | support/dktools/test-sqdbl.ctr | 37 |
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; +} + |