File: testAirExists.cxx

package info (click to toggle)
teem 1.12.0~20160122-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,404 kB
  • sloc: ansic: 152,549; python: 10,748; perl: 281; sh: 58; makefile: 44; cpp: 26
file content (24 lines) | stat: -rw-r--r-- 358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

typedef union {
  unsigned int i;
  float f;
} airFloat;

const airFloat airFloatQNaN = {0x7fffffff};
#define AIR_NAN  (airFloatQNaN.f)

#define AIR_CAST(t, v) ((t)(v))
#define AIR_EXISTS(x) (AIR_CAST(int, !((x) - (x))))

int main(int, char *[])
{
  double test = AIR_NAN;
  if(AIR_EXISTS(test))
    {
    return 1;
    }
  else
    {
    return 0;
    }
}