blob: 6ec065e36f10b639dc7c14116a8314cc4e29434d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}
|