java.lang.Object
org.eclipse.xtext.xbase.lib.BigDecimalExtensions
This is an extension library for
big decimal numbers.- Author:
- Jan Koehnlein - Initial contribution and API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalThe binarydivideoperator.static BigDecimalThe unaryminusoperator.static BigDecimalThe binaryminusoperator.static BigDecimalThe binarytimesoperator.static BigDecimalThe binaryplusoperator.static BigDecimaloperator_power(BigDecimal a, int exponent) Thepoweroperator.
-
Constructor Details
-
BigDecimalExtensions
public BigDecimalExtensions()
-
-
Method Details
-
operator_minus
The unaryminusoperator.- Parameters:
a- a BigDecimal. May not benull.- Returns:
-a- Throws:
NullPointerException- ifaisnull.
-
operator_plus
The binaryplusoperator.- Parameters:
a- a BigDecimal. May not benull.b- a BigDecimal. May not benull.- Returns:
a.add(b)- Throws:
NullPointerException- ifaorbisnull.
-
operator_minus
The binaryminusoperator.- Parameters:
a- a BigDecimal. May not benull.b- a BigDecimal. May not benull.- Returns:
a.subtract(b)- Throws:
NullPointerException- ifaorbisnull.
-
operator_power
Thepoweroperator.- Parameters:
a- a BigDecimal. May not benull.exponent- the exponent.- Returns:
a.pow(b)- Throws:
NullPointerException- ifaisnull.
-
operator_multiply
The binarytimesoperator.- Parameters:
a- a BigDecimal. May not benull.b- a BigDecimal. May not benull.- Returns:
a.multiply(b)- Throws:
NullPointerException- ifaorbisnull.
-
operator_divide
The binarydivideoperator.- Parameters:
a- a BigDecimal. May not benull.b- a BigDecimal. May not benull.- Returns:
a.divide(b, MathContext.DECIMAL128)- Throws:
NullPointerException- ifaorbisnull.
-