summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/files/test.c
blob: 2d8389c92eceef762e33e331b35e9c34c4462e33 (plain)
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
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

double convert(long long l)
{
  return (double)l;
}

int main(int argc, char * argv[]) {

  long long l = 10;
  double f;
  double check = 10.0;

  f = convert(l);
  printf("convert: %lld => %f\n", l, f);
  if ( f != check ) exit(1);

  f = 1234.67;
  check = 1234.0;
  printf("floorf(%f) = %f\n", f, floorf(f));
  if ( floorf(f) != check) exit(1);

  return 0;
}