2011-03-02 07:37:39 -05:00
|
|
|
|
|
|
|
#ifndef NAN_INF_H
|
|
|
|
#define NAN_INF_H
|
|
|
|
|
2016-10-05 18:16:44 -04:00
|
|
|
#define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x))
|
|
|
|
static inline int ISNANf(float x) { return x != x; }
|
|
|
|
static inline int ISNANd(double x) { return x != x; }
|
|
|
|
|
|
|
|
#define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x))
|
|
|
|
static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }
|
|
|
|
static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); }
|
2011-03-02 07:37:39 -05:00
|
|
|
|
|
|
|
#endif
|