File: dtostre-01.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 (27 lines) | stat: -rw-r--r-- 593 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
/* Nonregular cases.
   $Id: dtostre-01.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[] = {

    { { .fl = 1e-15 }, 3, 0,		"1.000e-15" },
    { { .fl = -1e-15 }, 3, 0,		"-1.000e-15" },

    { { .fl = 1.234567 }, 6, 0,		"1.234567e+00" },
    { { .fl = -1.234567 }, 6, 0,	"-1.234567e+00" },
    
    { { .fl = 9.876543 }, 6, 0,		"9.876543e+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;
}