MCPcopy Create free account
hub / github.com/Gecode/gecode / ceil_div_pp

Function ceil_div_pp

gecode/int/div.hpp:37–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36 template<class IntType>
37 forceinline IntType
38 ceil_div_pp(IntType x, IntType y) {
39 assert((x >= 0) && (y >= 0));
40 /*
41 * This is smarter than it looks: for many cpus, % and / are
42 * implemented by the same instruction and an optimizing compiler
43 * will generate the instruction only once.
44 */
45 return ((x % y) == 0) ? x/y : (x/y + 1);
46 }
47 template<class IntType>
48 forceinline IntType
49 floor_div_pp(IntType x, IntType y) {

Callers 6

ceil_div_pxFunction · 0.85
floor_div_pxFunction · 0.85
ceil_div_xpFunction · 0.85
floor_div_xpFunction · 0.85
propagateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected