Mercurial > hg > qm-dsp
view maths/nan-inf.h @ 512:a6bf4d97815e
Merge pull request #4 from tartina/fsfaddress
Correct Free Software Foundation address in COPYING
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Tue, 15 Oct 2019 09:43:11 +0100 |
parents | 701233f8ed41 |
children |
line wrap: on
line source
#ifndef QM_DSP_NAN_INF_H #define QM_DSP_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