Use BigDecimal for scalar values to prevent roundoff errors.