The current code would return 1 for 0, which is wrong. int _cairo_fixed_integer_ceil (cairo_fixed_t f) { - if (f >= 0) + if (f > 0) return ((f - 1)>>16) + 1; else return - (-f >> 16); } --behdad http://behdad.org/