Package org.eclipse.xtext.xbase.lib
Class BigDecimalExtensions
- java.lang.Object
-
- org.eclipse.xtext.xbase.lib.BigDecimalExtensions
-
@GwtCompatible public class BigDecimalExtensions extends java.lang.Object
This is an extension library forbig decimal numbers
.
-
-
Constructor Summary
Constructors Constructor Description BigDecimalExtensions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.math.BigDecimal
operator_divide(java.math.BigDecimal a, java.math.BigDecimal b)
The binarydivide
operator.static java.math.BigDecimal
operator_minus(java.math.BigDecimal a)
The unaryminus
operator.static java.math.BigDecimal
operator_minus(java.math.BigDecimal a, java.math.BigDecimal b)
The binaryminus
operator.static java.math.BigDecimal
operator_multiply(java.math.BigDecimal a, java.math.BigDecimal b)
The binarytimes
operator.static java.math.BigDecimal
operator_plus(java.math.BigDecimal a, java.math.BigDecimal b)
The binaryplus
operator.static java.math.BigDecimal
operator_power(java.math.BigDecimal a, int exponent)
Thepower
operator.
-
-
-
Method Detail
-
operator_minus
@Pure public static java.math.BigDecimal operator_minus(java.math.BigDecimal a)
The unaryminus
operator.- Parameters:
a
- a BigDecimal. May not benull
.- Returns:
-a
- Throws:
java.lang.NullPointerException
- ifa
isnull
.
-
operator_plus
@Pure public static java.math.BigDecimal operator_plus(java.math.BigDecimal a, java.math.BigDecimal b)
The binaryplus
operator.- Parameters:
a
- a BigDecimal. May not benull
.b
- a BigDecimal. May not benull
.- Returns:
a.add(b)
- Throws:
java.lang.NullPointerException
- ifa
orb
isnull
.
-
operator_minus
@Pure public static java.math.BigDecimal operator_minus(java.math.BigDecimal a, java.math.BigDecimal b)
The binaryminus
operator.- Parameters:
a
- a BigDecimal. May not benull
.b
- a BigDecimal. May not benull
.- Returns:
a.subtract(b)
- Throws:
java.lang.NullPointerException
- ifa
orb
isnull
.
-
operator_power
@Pure public static java.math.BigDecimal operator_power(java.math.BigDecimal a, int exponent)
Thepower
operator.- Parameters:
a
- a BigDecimal. May not benull
.exponent
- the exponent.- Returns:
a.pow(b)
- Throws:
java.lang.NullPointerException
- ifa
isnull
.
-
operator_multiply
@Pure public static java.math.BigDecimal operator_multiply(java.math.BigDecimal a, java.math.BigDecimal b)
The binarytimes
operator.- Parameters:
a
- a BigDecimal. May not benull
.b
- a BigDecimal. May not benull
.- Returns:
a.multiply(b)
- Throws:
java.lang.NullPointerException
- ifa
orb
isnull
.
-
operator_divide
@Pure public static java.math.BigDecimal operator_divide(java.math.BigDecimal a, java.math.BigDecimal b)
The binarydivide
operator.- Parameters:
a
- a BigDecimal. May not benull
.b
- a BigDecimal. May not benull
.- Returns:
a.divide(b, MathContext.DECIMAL128)
- Throws:
java.lang.NullPointerException
- ifa
orb
isnull
.
-
-