~ubuntu-branches/ubuntu/raring/avr-libc/raring-proposed

« back to all changes in this revision

Viewing changes to tests/simulate/stdlib/dtostrf-minmax.c

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2009-10-31 11:52:10 UTC
  • mfrom: (1.1.8 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091031115210-x0mlijnegkce86fk
Tags: 1:1.6.7-1
* New upstream relese (closes: #544030)
* Added lintian overrides (closes: #553265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Min and max float values.
2
 
   $Id: dtostrf-minmax.c,v 1.1 2007/02/06 12:36:58 dmix Exp $
3
 
 */
4
 
#include <stdlib.h>
5
 
#include <string.h>
6
 
#include "progmem.h"
7
 
 
8
 
#define PATTERN_SIZE    50
9
 
#include "dtostrf.h"
10
 
 
11
 
PROGMEM static const struct dtostrf_s t[] = {
12
 
 
13
 
    { { 0x00800000 }, 0, 45,
14
 
        "0.000000000000000000000000000000000000011754944"       },
15
 
    { { 0x00800000 }, 0, 44,
16
 
        "0.00000000000000000000000000000000000001175494"        },
17
 
    { { 0x00800000 }, 0, 43,
18
 
        "0.0000000000000000000000000000000000000117549" },
19
 
    { { 0x00800000 }, 0, 42,
20
 
        "0.000000000000000000000000000000000000011755"  },
21
 
    { { 0x00800000 }, 0, 41,
22
 
        "0.00000000000000000000000000000000000001175"   },
23
 
    { { 0x00800000 }, 0, 40,
24
 
        "0.0000000000000000000000000000000000000118"    },
25
 
    { { 0x00800000 }, 0, 39,
26
 
        "0.000000000000000000000000000000000000012"     },
27
 
    { { 0x00800000 }, 0, 38,
28
 
        "0.00000000000000000000000000000000000001"      },
29
 
    { { 0x00800000 }, 0, 37,
30
 
        "0.0000000000000000000000000000000000000"       },
31
 
    { { 0x00800000 }, 0, 36,
32
 
        "0.000000000000000000000000000000000000"        },
33
 
 
34
 
    { { 0x80800000 }, 0, 45,
35
 
        "-0.000000000000000000000000000000000000011754944"      },
36
 
    { { 0x00800000 }, 49, 45,
37
 
        "  0.000000000000000000000000000000000000011754944"     },
38
 
    { { 0x80800000 }, 49, 45,
39
 
        " -0.000000000000000000000000000000000000011754944"     },
40
 
 
41
 
#ifdef  __AVR__         /* Reason: Glibc calculate all digits.  */
42
 
    { { 0x7f7fffff }, 0, 0,
43
 
        "340282350000000000000000000000000000000" },
44
 
    { { 0xff7fffff }, 0, 0,
45
 
        "-340282350000000000000000000000000000000" },
46
 
#endif
47
 
 
48
 
};
49
 
 
50
 
int main ()
51
 
{
52
 
    int i;
53
 
    for (i= 0; (size_t)i != sizeof(t)/sizeof(t[0]); i++)
54
 
        run_dtostrf (t+i, i+1);
55
 
    return 0;
56
 
}