package com.sb.util;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

/**
 *
 */
public final class MathUtil
{
    
    private static MathContext context = MathContext.DECIMAL32;
    
    public static BigDecimal divide(BigDecimal numerator, BigDecimal denominator)
    {
        return numerator.divide(denominator, context);
    }
    
    public static BigDecimal divide(BigDecimal numerator, int denominator)
    {
        return divide(numerator, BigDecimal.valueOf(denominator));
    }
    
    public static BigDecimal divide(int numerator, int denominator)
    {
        return divide(BigDecimal.valueOf(numerator), denominator);
    }
    
    public static BigDecimal multiply(BigDecimal a, int multiplier)
    {
        return a.multiply(BigDecimal.valueOf(multiplier));
    }
    
    
    
    
    
}

@@ -526,32 +526,194 @@
 r));%0A    %7D%0A    %0A
+    public static BigDecimal divide(BigDecimal numerator, double denominator)%0A    %7B%0A        return divide(numerator, BigDecimal.valueOf(denominator));%0A    %7D%0A    %0A
     public stati
@@ -988,24 +988,171 @@
 %0A    %7D%0A    %0A
+    public static BigDecimal multiply(BigDecimal a, double multiplier)%0A    %7B%0A        return a.multiply(BigDecimal.valueOf(multiplier));%0A    %7D%0A    %0A
     %0A    %0A  

Add helpers that allow divisions and multiplication with doubles