comparison constant-q-cpp/src/dsp/nan-inf.h @ 366:5d0a2ebb4d17

Bring dependent libraries in to repo
author Chris Cannam
date Fri, 24 Jun 2016 14:47:45 +0100
parents
children
comparison
equal deleted inserted replaced
365:112766f4c34b 366:5d0a2ebb4d17
1
2 #ifndef NAN_INF_H
3 #define NAN_INF_H
4
5 #define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x))
6 static inline int ISNANf(float x) { return x != x; }
7 static inline int ISNANd(double x) { return x != x; }
8
9 #define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x))
10 static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }
11 static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); }
12
13 #endif