diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/constant-q-cpp/src/dsp/nan-inf.h	Fri Jun 24 14:47:45 2016 +0100
@@ -0,0 +1,13 @@
+
+#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