diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-03-17 18:56:15 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-03-17 18:56:15 +0000 |
commit | 6df453f2a274c81edbf09cc9065bcade6de6069c (patch) | |
tree | dd0a19bb151d25c7dce3eece6691960bc03d97e1 /src/jtutil | |
parent | c7c6ba87e9b37e4d2ac29a0cfc495e5403e52ba8 (diff) |
add ifloor() and iceil() functions
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@981 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/jtutil')
-rw-r--r-- | src/jtutil/util.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jtutil/util.hh b/src/jtutil/util.hh index 275e927..818f293 100644 --- a/src/jtutil/util.hh +++ b/src/jtutil/util.hh @@ -82,6 +82,10 @@ template <typename fp_t> // more misc math stuff, valid only if <math.h> has been #included // #ifdef PI // from "jt/stdc.h" + // floor/ceiling of double, returned as an int + inline int ifloor(double x) { return static_cast<int>(floor(x)); } + inline int iceil (double x) { return static_cast<int>(ceil (x)); } + // convert degrees <--> radians template <typename fp_t> inline fp_t degrees_of_radians(fp_t radians) { return (180.0/PI)*radians; } |