aboutsummaryrefslogtreecommitdiff
path: root/src/classify.c
diff options
context:
space:
mode:
authorschnetter <schnetter@b716e942-a2de-43ad-8f52-f3dfe468e4e7>2005-10-19 15:16:34 +0000
committerschnetter <schnetter@b716e942-a2de-43ad-8f52-f3dfe468e4e7>2005-10-19 15:16:34 +0000
commitb5796e9102b6a39b53a9cf0e4bde9b855974a0d3 (patch)
tree8462831aba56e2bb05904b4f17defc96045e9a89 /src/classify.c
parent5d7f29b265659df0b093a44f629b6c3d1c8b3b81 (diff)
Add Fortran functions that test for nan.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinUtils/TGRtensor/trunk@34 b716e942-a2de-43ad-8f52-f3dfe468e4e7
Diffstat (limited to 'src/classify.c')
-rw-r--r--src/classify.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/classify.c b/src/classify.c
new file mode 100644
index 0000000..a2feeb6
--- /dev/null
+++ b/src/classify.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
+}