math: do correctly rounded checks where it's appropriate