Mercurial > hg > silvet
annotate constant-q-cpp/src/dsp/nan-inf.h @ 372:af71cbdab621 tip
Update bqvec code
author | Chris Cannam |
---|---|
date | Tue, 19 Nov 2019 10:13:32 +0000 |
parents | 5d0a2ebb4d17 |
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 |