Returns the result of ceil(a / b) but uses integer arithmetic only.
1 assert(ceildiv(0, 3) == 0); 2 assert(ceildiv(1UL, 3UL) == 1UL); 3 assert(ceildiv(2L, 3L) == 1L); 4 assert(ceildiv(3U, 3U) == 1U); 5 assert(ceildiv(4, 3) == 2); 6 assert(ceildiv(-4, 4) == -1); 7 assert(ceildiv(-4, 3) == -1);
See Implementation
Returns the result of ceil(a / b) but uses integer arithmetic only.