File: dtostre-zero.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 (34 lines) | stat: -rw-r--r-- 951 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
/* $Id: dtostre-zero.c,v 1.1 2007/02/06 12:36:58 dmix Exp $ */

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

PROGMEM static const struct dtostre_s t[] = {
    
    { { 0 }, 0, 0,		"0e+00" },
    { { 0x80000000 }, 0, 0,	"-0e+00" },	/* 'minus 0'	*/
    { { 0 }, 0, DTOSTR_PLUS_SIGN,	"+0e+00" },
    { { 0 }, 0, DTOSTR_ALWAYS_SIGN,	" 0e+00" },
    { { 0 }, 0, DTOSTR_ALWAYS_SIGN | DTOSTR_PLUS_SIGN,	"+0e+00" },
    { { 0 }, 0, DTOSTR_UPPERCASE,	"0E+00" },
    { { 0 }, 1, 0,		"0.0e+00" },
    { { 0 }, 2, 0,		"0.00e+00" },
    { { 0 }, 3, 0,		"0.000e+00" },
    { { 0 }, 4, 0,		"0.0000e+00" },
    { { 0 }, 5, 0,		"0.00000e+00" },
    { { 0 }, 6, 0,		"0.000000e+00" },
    { { 0 }, 7, 0,		"0.0000000e+00" },
    { { 0 }, 8, 0,		"0.0000000e+00" },
    { { 0 }, 255, 0,		"0.0000000e+00" },

};

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