Top Description Constructors Methods
org.eclipse.xtext.xbase.lib

public Class BigDecimalExtensions

extends Object
Class Inheritance
Annotations
@GwtCompatible
Imports
java.math.BigDecimal, .MathContext, com.google.common.annotations.GwtCompatible

This is an extension library for big decimal numbers.
Author
Jan Koehnlein - Initial contribution and API

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static BigDecimal

Returns:

a.divide(b, MathContext.DECIMAL128)
operator_divide
(BigDecimal
a BigDecimal. May not be null.
a
,
BigDecimal
a BigDecimal. May not be null.
b
)

The binary divide operator.

public static BigDecimal

Returns:

-a
operator_minus
(BigDecimal
a BigDecimal. May not be null.
a
)

The unary minus operator.

public static BigDecimal

Returns:

a.subtract(b)
operator_minus
(BigDecimal
a BigDecimal. May not be null.
a
,
BigDecimal
a BigDecimal. May not be null.
b
)

The binary minus operator.

public static BigDecimal

Returns:

a.multiply(b)
operator_multiply
(BigDecimal
a BigDecimal. May not be null.
a
,
BigDecimal
a BigDecimal. May not be null.
b
)

The binary times operator.

public static BigDecimal

Returns:

a.add(b)
operator_plus
(BigDecimal
a BigDecimal. May not be null.
a
,
BigDecimal
a BigDecimal. May not be null.
b
)

The binary plus operator.

public static BigDecimal

Returns:

a.pow(b)
operator_power
(BigDecimal
a BigDecimal. May not be null.
a
,
int
the exponent.
exponent
)

The power operator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BigDecimalExtensionsback to summary
public BigDecimalExtensions()

Method Detail

operator_divideback to summary
public static BigDecimal operator_divide(BigDecimal a, BigDecimal b)

The binary divide operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

b:BigDecimal

a BigDecimal. May not be null.

Returns:BigDecimal

a.divide(b, MathContext.DECIMAL128)

Annotations
@Pure
@Inline:$1.divide($2, $3.DECIMAL128)
imported:MathContext
Exceptions
NullPointerException:
if a or b is null.
operator_minusback to summary
public static BigDecimal operator_minus(BigDecimal a)

The unary minus operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

Returns:BigDecimal

-a

Annotations
@Pure
@Inline:$1.negate()
Exceptions
NullPointerException:
if a is null.
operator_minusback to summary
public static BigDecimal operator_minus(BigDecimal a, BigDecimal b)

The binary minus operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

b:BigDecimal

a BigDecimal. May not be null.

Returns:BigDecimal

a.subtract(b)

Annotations
@Pure
@Inline:$1.subtract($2)
Exceptions
NullPointerException:
if a or b is null.
operator_multiplyback to summary
public static BigDecimal operator_multiply(BigDecimal a, BigDecimal b)

The binary times operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

b:BigDecimal

a BigDecimal. May not be null.

Returns:BigDecimal

a.multiply(b)

Annotations
@Pure
@Inline:$1.multiply($2)
Exceptions
NullPointerException:
if a or b is null.
operator_plusback to summary
public static BigDecimal operator_plus(BigDecimal a, BigDecimal b)

The binary plus operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

b:BigDecimal

a BigDecimal. May not be null.

Returns:BigDecimal

a.add(b)

Annotations
@Pure
@Inline:$1.add($2)
Exceptions
NullPointerException:
if a or b is null.
operator_powerback to summary
public static BigDecimal operator_power(BigDecimal a, int exponent)

The power operator.

Parameters
a:BigDecimal

a BigDecimal. May not be null.

exponent:int

the exponent.

Returns:BigDecimal

a.pow(b)

Annotations
@Pure
@Inline:$1.pow($2)
Exceptions
NullPointerException:
if a is null.