File: dtostrf-big.c

package info (click to toggle)
avr-libc 1%3A1.6.2.cvs20080610-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 14,848 kB
  • ctags: 55,619
  • sloc: ansic: 92,267; asm: 6,692; sh: 4,131; makefile: 2,481; python: 976; pascal: 426; perl: 116
file content (76 lines) | stat: -rw-r--r-- 2,381 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* $Id: dtostrf-big.c,v 1.1 2007/02/06 12:36:58 dmix Exp $ */

#include <stdlib.h>
#include <string.h>
#include "progmem.h"

#define PATTERN_SIZE	270
#include "dtostrf.h"

PROGMEM static const struct dtostrf_s t[] = {

    { { .fl = 1.2345678 }, 127, 7,
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                      1.2345678" },

    { { .fl = 1.2345678 }, -128, 7,
	"1.2345678                       "	/* 32 */
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                                " },

    { { .fl = -1.2345678 }, 127, 7,
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                     -1.2345678" },

    { { .fl = -1.2345678 }, -128, 7,
	"-1.2345678                      "	/* 32 */
	"                                "	/* 32 */
	"                                "	/* 32 */
	"                                " },

    { { .fl = 12345678. }, 0, 255,
	"12345678."
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"0000000000000000000000000000000" },

    { { .fl = -12345678. }, 0, 255,
	"-12345678."
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"0000000000000000000000000000000" },

    { { .fl = .5 }, 0, 255,
	"0."
	"50000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"00000000000000000000000000000000"	/* 32 */
	"0000000000000000000000000000000" },
};

int main ()
{
    int i;
    for (i= 0; (size_t)i != sizeof(t)/sizeof(t[0]); i++)
	run_dtostrf (t+i, i+1);
    return 0;
}