diff options
author | Robin Gareus <robin@gareus.org> | 2016-10-06 00:16:44 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-10-06 00:57:53 +0200 |
commit | f68d2e06bcfb81efda107d3b4c3aa7dbc2d73bc2 (patch) | |
tree | 286d5b2b1c3573c2fbfc77b4d29b0b2a6bfa9686 /libs/qm-dsp/maths/nan-inf.h | |
parent | 2a27cc475867612afd261e5bf3b2a1a42b9c75cc (diff) |
update qm-dsp library
Diffstat (limited to 'libs/qm-dsp/maths/nan-inf.h')
-rw-r--r-- | libs/qm-dsp/maths/nan-inf.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libs/qm-dsp/maths/nan-inf.h b/libs/qm-dsp/maths/nan-inf.h index 8191713000..c6be51276a 100644 --- a/libs/qm-dsp/maths/nan-inf.h +++ b/libs/qm-dsp/maths/nan-inf.h @@ -2,19 +2,12 @@ #ifndef NAN_INF_H #define NAN_INF_H -#include <math.h> - -#ifdef sun - -#include <ieeefp.h> -#define ISNAN(x) ((sizeof(x)==sizeof(float))?isnanf(x):isnand(x)) -#define ISINF(x) (!finite(x)) - -#else - -#define ISNAN(x) isnan(x) -#define ISINF(x) isinf(x) - -#endif +#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 |