diff options
author | ianhin <ianhin> | 2006-02-01 19:48:33 +0000 |
---|---|---|
committer | ianhin <ianhin> | 2006-02-01 19:48:33 +0000 |
commit | c0a6354c49949b548de243703e40f0e6dc6c0fe8 (patch) | |
tree | 0f5df0e34cb44804239930fd2ce464cf3f0db067 /Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c | |
parent | 5829e893ed59539056030281c2de5ad6d6c6d968 (diff) |
Added sgn function for determining sign of a number. Is there
somewhere else this can be found?
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c index c3aa020..3750cf1 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c @@ -33,9 +33,21 @@ #include "cctk_Parameters.h" #include "Symmetry.h" + +#define KRANC_C #include "GenericFD.h" /* TODO: provide functions for differencing, use FD macros to evaluate == use macros to evaluate corresponding functions */ + +CCTK_INT sgn(CCTK_REAL x) +{ + if (x < 0) + return -1; + else if (x > 0) + return 1; + else + return 0; +} |