tweak remainder for rationals