qm-dsp  1.8
nan-inf.h
Go to the documentation of this file.
00001 
00002 #ifndef NAN_INF_H
00003 #define NAN_INF_H
00004 
00005 #define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x))
00006 static inline int ISNANf(float x) { return x != x; }
00007 static inline int ISNANd(double x) { return x != x; }
00008           
00009 #define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x))
00010 static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }
00011 static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); }
00012 
00013 #endif