From 8f377c56d5b0cc81d5fb7c5cd29b3aeee50957ce Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 16 Aug 2012 14:53:21 -0400 Subject: Reinstate dir[] naming work-around; translate Sign[] to isgn() --- .../Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Auxiliary/Cactus') diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h index e3f21a0..81a70d9 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h @@ -63,6 +63,17 @@ KRANC_WHERE static inline CCTK_REAL sgn(CCTK_REAL x) return x==(CCTK_REAL)0.0 ? (CCTK_REAL)0.0 : copysign((CCTK_REAL)1.0, x); } +KRANC_WHERE static inline int isgn(CCTK_REAL x) +{ + if (x == (CCTK_REAL)0.0) return 0; +#ifdef __cplusplus + int s = std::signbit(x); +#else + int s = signbit(x); +#endif + return s ? -1 : +1; +} + int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH); void GenericFD_GetBoundaryInfo(cGH const * restrict cctkGH, -- cgit v1.2.3