Mercurial > hg > constant-q-cpp
view src/dsp/nan-inf.h @ 174:5ed6e970541b
Remote location for this subrepo is unresponsive, include sources in this repo instead
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 17 Jul 2015 15:48:01 +0100 |
parents | 2375457f2876 |
children |
line wrap: on
line source
#ifndef NAN_INF_H #define NAN_INF_H #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); } #endif