title: java math library for BigDecimal which allows null values
body: <p>Is there a BigDecimal library with the basic operations of BigDecimal which allows null values?</p>
  
  <p>Null should be treated as 0 for mathematical purpose.</p>
  
  <p>I don't want to do all the null checks for possible null values.</p>
  
  <p>You either never allow null values in database, application or view and initialize everything with <code>new BigDecimal(0)</code> or perform null checks on every usage for nullable values.</p>
  
  <p>Something like:</p>
  
  <pre><code>public static BigDecimal add(final BigDecimal value, final BigDecimal augend)
  {
      if (value == null)
          return augend;
      else if (augend == null)
          return value;
      else
          return value.add(augend);
  }
  
  public static BigDecimal multiply(final BigDecimal value, final BigDecimal multiplicand)
  {
      if (value == null || multiplicand == null)
          return null;
  
      return value.multiply(multiplicand);
  }
  </code></pre>