Class BigDecimalExtensions

java.lang.Object
org.eclipse.xtext.xbase.lib.BigDecimalExtensions

@GwtCompatible public class BigDecimalExtensions extends Object
This is an extension library for big decimal numbers.
Author:
Jan Koehnlein - Initial contribution and API
  • Constructor Details

    • BigDecimalExtensions

      public BigDecimalExtensions()
  • Method Details

    • operator_minus

      @Pure public static BigDecimal operator_minus(BigDecimal a)
      The unary minus operator.
      Parameters:
      a - a BigDecimal. May not be null.
      Returns:
      -a
      Throws:
      NullPointerException - if a is null.
    • operator_plus

      @Pure public static BigDecimal operator_plus(BigDecimal a, BigDecimal b)
      The binary plus operator.
      Parameters:
      a - a BigDecimal. May not be null.
      b - a BigDecimal. May not be null.
      Returns:
      a.add(b)
      Throws:
      NullPointerException - if a or b is null.
    • operator_minus

      @Pure public static BigDecimal operator_minus(BigDecimal a, BigDecimal b)
      The binary minus operator.
      Parameters:
      a - a BigDecimal. May not be null.
      b - a BigDecimal. May not be null.
      Returns:
      a.subtract(b)
      Throws:
      NullPointerException - if a or b is null.
    • operator_power

      @Pure public static BigDecimal operator_power(BigDecimal a, int exponent)
      The power operator.
      Parameters:
      a - a BigDecimal. May not be null.
      exponent - the exponent.
      Returns:
      a.pow(b)
      Throws:
      NullPointerException - if a is null.
    • operator_multiply

      @Pure public static BigDecimal operator_multiply(BigDecimal a, BigDecimal b)
      The binary times operator.
      Parameters:
      a - a BigDecimal. May not be null.
      b - a BigDecimal. May not be null.
      Returns:
      a.multiply(b)
      Throws:
      NullPointerException - if a or b is null.
    • operator_divide

      @Pure public static BigDecimal operator_divide(BigDecimal a, BigDecimal b)
      The binary divide operator.
      Parameters:
      a - a BigDecimal. May not be null.
      b - a BigDecimal. May not be null.
      Returns:
      a.divide(b, MathContext.DECIMAL128)
      Throws:
      NullPointerException - if a or b is null.