#include #include "stdc.h" #include "util.h" namespace AHFinderDirect { namespace jtutil { template int round::to_integer(fp_t x) { return (x >= 0.0) ? int(x + 0.5) // eg 3.6 --> int(4.1) = 4 : -int((-x) + 0.5); // eg -3.6 --> - int(4.1) = -4 } template int round::floor(fp_t x) { return (x >= 0.0) ? int(x) : -ceiling(-x); } template int round::ceiling(fp_t x) { return (x >= 0.0) ? int(x) + (x != fp_t(int(x))) : -floor(-x); } template class round; template class round; } // namespace jtutil } // namespace AHFinderDirect