Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / regression / tcc / 110_average.c
blob273b5110736366173024c68f5fe7ea277091c859
1 #include <stdio.h>
3 typedef struct
5 double average;
6 int count;
8 stats_type;
10 static void
11 testc (stats_type *s, long long data)
13 s->average = (s->average * s->count + data) / (s->count + 1);
14 s->count++;
17 int main (void)
19 stats_type s;
21 s.average = 0;
22 s.count = 0;
23 testc (&s, 10);
24 testc (&s, 20);
25 printf ("%g %d\n", s.average, s.count);
26 return 0;