math: use the rounding idiom consistently