23 #ifndef COMPILER_INT128_SUPPORT
24 #include <boost/multiprecision/cpp_int.hpp>
28 #define PBD_IDIV_ASR(x) ((x) < 0 ? -1 : 0)
36 #define PBD_IDIV_ROUNDING(x,y) ( (y)/2 - (PBD_IDIV_ASR((x)^(y)) & (y)))
54 #ifndef COMPILER_INT128_SUPPORT
55 boost::multiprecision::int512_t bignum = v;
63 return bignum.convert_to<int64_t> ();
66 fatal <<
"arithmetic overflow in timeline math\n" <<
endmsg;
75 __int128 vn (_v * _n);
85 return(int64_t) ((vn + hd) / _d);
92 #ifndef COMPILER_INT128_SUPPORT
93 boost::multiprecision::int512_t bignum = v;
100 return bignum.convert_to<int64_t> ();
103 fatal <<
"arithmetic overflow in timeline math\n" <<
endmsg;
119 return(int64_t) ((_v * _n) / _d);
T int_div_round(T x, T y)
#define PBD_IDIV_ROUNDING(x, y)
int64_t muldiv_floor(int64_t v, int64_t n, int64_t d)
int64_t muldiv_round(int64_t v, int64_t n, int64_t d)
std::ostream & endmsg(std::ostream &ostr)