DRILL-793: Fix output type's scale and precision for math functions.