There's a solution for both positive and negative x but only for positive y with just 1 division and without branches:
int ceildiv_ceil(int x, int y) { return x / y + (x % y > 0); } Note, if x is positive then division is towards zero, and we should add 1 if reminder is not zero.
If x is negative then division is towards zero, that's what we need, and we will not add anything because x % y is not positive