aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-02-13 11:01:46 -0600
committerErik Schnetter <schnetter@cct.lsu.edu>2010-02-13 11:01:46 -0600
commit8190749490b634fa8cc479385fa7bffc2586c4d1 (patch)
tree4ee5ed46335a2c748cfbd8bae51010763dd4f07d /Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
parentd80055607ec46c7ec3a2ce62335043b72ecb5e00 (diff)
Use signbit insted of sgn in C.
Use constants M_E and M_PI instead of explicit constants in C. Append "d0" to constants for e and pi in Fortran to make them double precision.
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
index cef5d7e..29c89d1 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
@@ -30,9 +30,18 @@
#define Cosh(x) (cosh(x))
#define Tanh(x) (tanh(x))
+#ifdef KRANC_C
+#define Sign(x) (signbit(x)?-1:+1)
+#else
#define Sign(x) (sgn(x))
+#endif
-#define E 2.71828182845904523536029
-#define Pi 3.14159265358979323846264
+#ifdef KRANC_C
+#define E M_E
+#define Pi M_PI
+#else
+#define E 2.71828182845904523536029d0
+#define Pi 3.14159265358979323846264d0
+#endif
#define UnitStep(x) ( (x) > 0 ? 1 : 0 )