org.eclipse.xtext.xbase.lib
Class BigIntegerExtensions

java.lang.Object
  extended by org.eclipse.xtext.xbase.lib.BigIntegerExtensions

public class BigIntegerExtensions
extends Object

This is an extension library for big integral numbers.

Author:
Jan Koehnlein - Initial contribution and API

Constructor Summary
BigIntegerExtensions()
           
 
Method Summary
static BigInteger operator_divide(BigInteger a, BigInteger b)
          The binary divide operator.
static BigInteger operator_minus(BigInteger a)
          The unary minus operator.
static BigInteger operator_minus(BigInteger a, BigInteger b)
          The binary minus operator.
static BigInteger operator_modulo(BigInteger a, BigInteger b)
          The binary modulo operator.
static BigInteger operator_multiply(BigInteger a, BigInteger b)
          The binary times operator.
static BigInteger operator_plus(BigInteger a, BigInteger b)
          The binary plus operator.
static BigInteger operator_power(BigInteger a, int exponent)
          The power operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigIntegerExtensions

public BigIntegerExtensions()
Method Detail

operator_minus

public static BigInteger operator_minus(BigInteger a)
The unary minus operator.

Parameters:
a - a BigInteger. May not be null.
Returns:
-a
Throws:
NullPointerException - if a is null.

operator_plus

public static BigInteger operator_plus(BigInteger a,
                                       BigInteger b)
The binary plus operator.

Parameters:
a - a BigInteger. May not be null.
b - a BigInteger. May not be null.
Returns:
a.add(b)
Throws:
NullPointerException - if a or b is null.

operator_minus

public static BigInteger operator_minus(BigInteger a,
                                        BigInteger b)
The binary minus operator.

Parameters:
a - a BigInteger. May not be null.
b - a BigInteger. May not be null.
Returns:
a.subtract(b)
Throws:
NullPointerException - if a or b is null.

operator_power

public static BigInteger operator_power(BigInteger a,
                                        int exponent)
The power operator.

Parameters:
a - a BigInteger. May not be null.
exponent - the exponent.
Returns:
a.pow(b)
Throws:
NullPointerException - if a null.

operator_multiply

public static BigInteger operator_multiply(BigInteger a,
                                           BigInteger b)
The binary times operator.

Parameters:
a - a BigInteger. May not be null.
b - a BigInteger. May not be null.
Returns:
a.multiply(b)
Throws:
NullPointerException - if a or b is null.

operator_divide

public static BigInteger operator_divide(BigInteger a,
                                         BigInteger b)
The binary divide operator.

Parameters:
a - a BigInteger. May not be null.
b - a BigInteger. May not be null.
Returns:
a.divide(b)
Throws:
NullPointerException - if a or b is null.

operator_modulo

public static BigInteger operator_modulo(BigInteger a,
                                         BigInteger b)
The binary modulo operator.

Parameters:
a - a BigInteger. May not be null.
b - a BigInteger. May not be null.
Returns:
a.mod(b)
Throws:
NullPointerException - if a or b is null.


Copyright © 2012. All Rights Reserved.