File: dtostre-subnrm.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 (38 lines) | stat: -rw-r--r-- 1,117 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
/* Test for subnormal numbers.
   $Id: dtostre-subnrm.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[] = {

    { { 0x007fffff }, 7, 0,	"1.1754942e-38" },

    { { 0x00000001 }, 0, 0,	"1e-45" },
    { { 0x00000001 }, 1, 0,	"1.4e-45" },
    { { 0x00000001 }, 2, 0,	"1.40e-45" },
    { { 0x00000001 }, 3, 0,	"1.401e-45" },
    { { 0x00000001 }, 4, 0,	"1.4013e-45" },
    { { 0x00000001 }, 5, 0,	"1.40130e-45" },
/*    { { 0x00000001 }, 6, 0,	"1.401298e-45" },	*/
/*    { { 0x00000001 }, 7, 0,	"1.4012985e-45" },	*/

    { { 0x00000002 }, 0, 0,	"3e-45" },
    { { 0x00000002 }, 1, 0,	"2.8e-45" },
    { { 0x00000002 }, 2, 0,	"2.80e-45" },
    { { 0x00000002 }, 3, 0,	"2.803e-45" },
    { { 0x00000002 }, 4, 0,	"2.8026e-45" },
    { { 0x00000002 }, 5, 0,	"2.80260e-45" },
/*    { { 0x00000002 }, 6, 0,	"2.802597e-45" },	*/
/*    { { 0x00000002 }, 7, 0,	"2.8025969e-45" },	*/
};

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