I haven't yet tested this, but what about something like the following: ...perhaps forget about the constant check, and just force the power of two check: \ if (!(__y & (__y >> 1))) { \ __x = round_up(x, y); \ } else { \