Lines Matching refs:num
18 constexpr auto DivideRoundingUp(Integer num, Integer denom) { in DivideRoundingUp() argument
20 num *= -1; in DivideRoundingUp()
23 if (num < Integer{0}) { in DivideRoundingUp()
24 return num / denom; in DivideRoundingUp()
26 return (num + denom - Integer{1}) / denom; in DivideRoundingUp()
33 constexpr Integer DividePositivesRoundingUp(Integer num, Integer denom) { in DividePositivesRoundingUp() argument
34 return DivideRoundingUp<typename std::make_unsigned<Integer>::type>(num, in DividePositivesRoundingUp()
45 constexpr auto DivideRoundingNearest(Integer num, Integer denom) { in DivideRoundingNearest() argument
47 num *= -1; in DivideRoundingNearest()
50 if (num < Integer{0}) { in DivideRoundingNearest()
51 return (num - ((denom - Integer{1}) / 2)) / denom; in DivideRoundingNearest()
53 return (num + (denom / 2)) / denom; in DivideRoundingNearest()
60 constexpr Integer DividePositivesRoundingNearest(Integer num, Integer denom) { in DividePositivesRoundingNearest() argument
62 num, denom); in DividePositivesRoundingNearest()