Decimal arithmetic behavior --- better logic to determine the output scale and precision