当x是一个无效值(NaN, Not a Number) 时,返回非零值 否则返回0
#ifndef Nan_h__
#define Nan_h__
#define NAN log(-1.0) //无效值NaN
#define isNAN(x) ((x)!=(x))
#define NINF log(0.0) //负无穷大
#define INF -NINF //无穷大
#define PINF -NINF //正无穷大
#define isINF(x) (((x)==PINF)||((x)==NINF))
#define isPINF(x) ((x)==PINF)
#define isNINF(x) ((x)==NINF)
#endif // Nan_h__
原文地址:http://blog.csdn.net/l_andy/article/details/38078977