[Math] Factored the rounding mode calculations in the Calculator