In order to use this class in your project, add this dependency in your project build file:
sun.misc

## Class FDBigInteger

• ```public class FDBigInteger
extends Object```
A simple big integer package specifically for floating point base conversion.
• ### Field Summary

Fields
Modifier and Type Field and Description
`static FDBigInteger` `FIVE`
`static FDBigInteger` `ONE`
`static FDBigInteger` `ZERO`
• ### Constructor Summary

Constructors
Constructor and Description
```FDBigInteger(long lValue, char[] digits, int kDigits, int nDigits)```
Constructs an `FDBigInteger` from a starting value and some decimal digits.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`int` ```addAndCmp(FDBigInteger x, FDBigInteger y)```
Compares this `FDBigInteger` with `x + y`.
`int` `cmp(FDBigInteger other)`
Compares the parameter with this `FDBigInteger`.
`int` ```cmpPow52(int p5, int p2)```
Compares this `FDBigInteger` with `5p5 * 2p2`.
`int` `getNormalizationBias()`
Retrieves the normalization bias of the `FDBigIntger`.
`FDBigInteger` `leftInplaceSub(FDBigInteger subtrahend)`
Subtracts the supplied `FDBigInteger` subtrahend from this `FDBigInteger`.
`FDBigInteger` `leftShift(int shift)`
Shifts this `FDBigInteger` to the left.
`void` `makeImmutable()`
Makes this `FDBigInteger` immutable.
`FDBigInteger` `multBy10()`
Multiplies this `FDBigInteger` by 10.
`FDBigInteger` ```multByPow52(int p5, int p2)```
Multiplies this `FDBigInteger` by `5p5 * 2p2`.
`int` `quoRemIteration(FDBigInteger S)`
Computes
`FDBigInteger` `rightInplaceSub(FDBigInteger subtrahend)`
Subtracts the supplied `FDBigInteger` subtrahend from this `FDBigInteger`.
`BigInteger` `toBigInteger()`
Converts this `FDBigInteger` to a `BigInteger`.
`String` `toHexString()`
Converts this `FDBigInteger` to a hexadecimal string.
`static FDBigInteger` ```valueOfMulPow52(long value, int p5, int p2)```
Returns an `FDBigInteger` with the numerical value `value * 5p5 * 2p2`.
`static FDBigInteger` ```valueOfPow52(int p5, int p2)```
Returns an `FDBigInteger` with the numerical value `5p5 * 2p2`.
• ### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### FIVE

`public static final FDBigInteger FIVE`
• #### ONE

`public static final FDBigInteger ONE`
• #### ZERO

`public static final FDBigInteger ZERO`
• ### Constructor Detail

• #### FDBigInteger

```public FDBigInteger(long lValue,
char[] digits,
int kDigits,
int nDigits)```
Constructs an `FDBigInteger` from a starting value and some decimal digits.
Parameters:
`lValue` - The starting value.
`digits` - The decimal digits.
`kDigits` - The initial index into `digits`.
`nDigits` - The final index into `digits`.
• ### Method Detail

```public int addAndCmp(FDBigInteger x,
FDBigInteger y)```
Compares this `FDBigInteger` with `x + y`. Returns a value according to the comparison as:
``` -1: this <  x + y
0: this == x + y
1: this >  x + y
```
Parameters:
`x` - The first addend of the sum to compare.
`y` - The second addend of the sum to compare.
Returns:
-1, 0, or 1 according to the result of the comparison.
• #### cmp

`public int cmp(FDBigInteger other)`
Compares the parameter with this `FDBigInteger`. Returns an integer accordingly as:
``` >0: this > other
0: this == other
<0: this < other
```
Parameters:
`other` - The `FDBigInteger` to compare.
Returns:
A negative value, zero, or a positive value according to the result of the comparison.
• #### cmpPow52

```public int cmpPow52(int p5,
int p2)```
Compares this `FDBigInteger` with `5p5 * 2p2`. Returns an integer accordingly as:
``` >0: this > other
0: this == other
<0: this < other
```
Parameters:
`p5` - The exponent of the power-of-five factor.
`p2` - The exponent of the power-of-two factor.
Returns:
A negative value, zero, or a positive value according to the result of the comparison.
• #### getNormalizationBias

`public int getNormalizationBias()`
Retrieves the normalization bias of the `FDBigIntger`. The normalization bias is a left shift such that after it the highest word of the value will have the 4 highest bits equal to zero: `(highestWord & 0xf0000000) == 0`, but the next bit should be 1 `(highestWord & 0x08000000) != 0`.
Returns:
The normalization bias.
• #### leftInplaceSub

`public FDBigInteger leftInplaceSub(FDBigInteger subtrahend)`
Subtracts the supplied `FDBigInteger` subtrahend from this `FDBigInteger`. Assert that the result is positive. If the subtrahend is immutable, store the result in this(minuend). If this(minuend) is immutable a new `FDBigInteger` is created.
Parameters:
`subtrahend` - The `FDBigInteger` to be subtracted.
Returns:
This `FDBigInteger` less the subtrahend.
• #### leftShift

`public FDBigInteger leftShift(int shift)`
Shifts this `FDBigInteger` to the left. The shift is performed in-place unless the `FDBigInteger` is immutable in which case a new instance of `FDBigInteger` is returned.
Parameters:
`shift` - The number of bits to shift left.
Returns:
The shifted `FDBigInteger`.
• #### makeImmutable

`public void makeImmutable()`
Makes this `FDBigInteger` immutable.
• #### multBy10

`public FDBigInteger multBy10()`
Multiplies this `FDBigInteger` by 10. The operation will be performed in place unless the `FDBigInteger` is immutable in which case a new `FDBigInteger` will be returned.
Returns:
The `FDBigInteger` multiplied by 10.
• #### multByPow52

```public FDBigInteger multByPow52(int p5,
int p2)```
Multiplies this `FDBigInteger` by `5p5 * 2p2`. The operation will be performed in place if possible, otherwise a new `FDBigInteger` will be returned.
Parameters:
`p5` - The exponent of the power-of-five factor.
`p2` - The exponent of the power-of-two factor.
Returns:
• #### quoRemIteration

```public int quoRemIteration(FDBigInteger S)
throws IllegalArgumentException```
Computes
``` q = (int)( this / S )
this = 10 * ( this mod S )
Return q.
```
This is the iteration step of digit development for output. We assume that S has been normalized, as above, and that "this" has been left-shifted accordingly. Also assumed, of course, is that the result, q, can be expressed as an integer, 0 <= q < 10.
Parameters:
`S` - The divisor of this `FDBigInteger`.
Returns:
`q = (int)(this / S)`.
Throws:
`IllegalArgumentException`
• #### rightInplaceSub

`public FDBigInteger rightInplaceSub(FDBigInteger subtrahend)`
Subtracts the supplied `FDBigInteger` subtrahend from this `FDBigInteger`. Assert that the result is positive. If the this(minuend) is immutable, store the result in subtrahend. If subtrahend is immutable a new `FDBigInteger` is created.
Parameters:
`subtrahend` - The `FDBigInteger` to be subtracted.
Returns:
This `FDBigInteger` less the subtrahend.
• #### toBigInteger

`public BigInteger toBigInteger()`
Converts this `FDBigInteger` to a `BigInteger`.
Returns:
The `BigInteger` representation.
• #### toHexString

`public String toHexString()`
Converts this `FDBigInteger` to a hexadecimal string.
Returns:
• #### valueOfMulPow52

```public static FDBigInteger valueOfMulPow52(long value,
int p5,
int p2)```
Returns an `FDBigInteger` with the numerical value `value * 5p5 * 2p2`.
Parameters:
`value` - The constant factor.
`p5` - The exponent of the power-of-five factor.
`p2` - The exponent of the power-of-two factor.
Returns:
`value * 5p5 * 2p2`
• #### valueOfPow52

```public static FDBigInteger valueOfPow52(int p5,
int p2)```
Returns an `FDBigInteger` with the numerical value `5p5 * 2p2`.
Parameters:
`p5` - The exponent of the power-of-five factor.
`p2` - The exponent of the power-of-two factor.
Returns:
`5p5 * 2p2`