From 8190749490b634fa8cc479385fa7bffc2586c4d1 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 13 Feb 2010 11:01:46 -0600 Subject: 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. --- .../KrancNumericalTools/GenericFD/src/MathematicaCompat.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h') 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 ) -- cgit v1.2.3