aboutsummaryrefslogtreecommitdiff
path: root/src/isnan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/isnan.c')
-rw-r--r--src/isnan.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/isnan.c b/src/isnan.c
new file mode 100644
index 0000000..a2feeb6
--- /dev/null
+++ b/src/isnan.c
@@ -0,0 +1,32 @@
+/* $Header$ */
+
+#include <math.h>
+
+#include "cctk.h"
+
+int CCTK_FCALL CCTK_FNAME(TAT_isnan) (const CCTK_REAL * restrict const x)
+{
+#ifdef HAVE_ISNAN
+ return isnan(*x);
+#else
+ return 0;
+#endif
+}
+
+int CCTK_FCALL CCTK_FNAME(TAT_isinf) (const CCTK_REAL * restrict const x)
+{
+#ifdef HAVE_ISINF
+ return isinf(*x);
+#else
+ return 0;
+#endif
+}
+
+int CCTK_FCALL CCTK_FNAME(TAT_finite) (const CCTK_REAL * restrict const x)
+{
+#ifdef HAVE_FINITE
+ return finite(*x);
+#else
+ return 1;
+#endif
+}