Mercurial > hg > silvet
annotate 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 |
rev | line source |
---|---|
Chris@366 | 1 |
Chris@366 | 2 #ifndef NAN_INF_H |
Chris@366 | 3 #define NAN_INF_H |
Chris@366 | 4 |
Chris@366 | 5 #define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x)) |
Chris@366 | 6 static inline int ISNANf(float x) { return x != x; } |
Chris@366 | 7 static inline int ISNANd(double x) { return x != x; } |
Chris@366 | 8 |
Chris@366 | 9 #define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x)) |
Chris@366 | 10 static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); } |
Chris@366 | 11 static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); } |
Chris@366 | 12 |
Chris@366 | 13 #endif |