# Class: com.pnfsoftware.jeb.util.primitives.LargeIntHandler

Handler for large integers of a given maximum bitsize. Those objects are created through a factory method.

## Method: add
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Add two signed values and truncate the result.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Method: and
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Bitwise AND two values and truncate the result.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Method: clearbit
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Clear a bit in a value and truncate the result.
parameter: a: value
parameter: n: bit index
return: the truncated result

## Method: compare
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `int`

Description: Compare two signed values.
parameter: a: first value
parameter: b: second value
return: a negative value, zero, or a positive value if `a` is respectively below,         equal to, or above `b`

## Method: compareU
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `int`

Description: Compare two unsigned values.
parameter: a: first value
parameter: b: second value
return: a negative value, zero, or a positive value if `a` is respectively below,         equal to, or above `b` in unsigned order

## Method: create
- parameter: `val`, type: `java.lang.String`
- return type: `java.math.BigInteger`

Description: Create a new big integer. The client is responsible for making sure that the two\-complement representation of the value fits within [bitsize](#getBitsize()) bits.
parameter: val: string value \(decimal, hex, or octal \- with the right associated prefix or suffix\)
return: the parsed value

## Method: div2S
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger[]`

Description: Divide a double\-width signed dividend by a signed divisor.
parameter: a: double\-width dividend
parameter: b: divisor
return: two elements: truncated quotient and truncated remainder

## Method: div2U
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger[]`

Description: Divide a double\-width unsigned dividend by an unsigned divisor.
parameter: a: double\-width dividend
parameter: b: divisor
return: two elements: truncated quotient and truncated remainder

## Method: divS
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Divide two signed values and truncate the quotient.
parameter: a: dividend
parameter: b: divisor
return: the truncated quotient

## Method: divU
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Divide two unsigned values and truncate the quotient.
parameter: a: dividend
parameter: b: divisor
return: the truncated quotient

## Method: getBitsize
- return type: `int`

Description: Get the fixed integer bit size.
return: the bit size

## Method: mul2S
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Multiply two signed values and truncate the result to twice the handler bit size.
parameter: a: first value
parameter: b: second value
return: the double\-width truncated result

## Method: mul2U
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Multiply two unsigned values and truncate the result to twice the handler bit size.
parameter: a: first value
parameter: b: second value
return: the double\-width truncated result

## Method: mulS
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Multiply two signed values and truncate the result to the handler bit size.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Method: mulU
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Multiply two unsigned values and truncate the result to the handler bit size.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Method: neg
- parameter: `a`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Negate a signed value and truncate the result.
parameter: a: value to negate
return: the truncated result

## Method: not
- parameter: `a`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Bitwise NOT a value and truncate the result.
parameter: a: value
return: the truncated result

## Method: or
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Bitwise OR two values and truncate the result.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Method: remS
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Compute the signed remainder and truncate it.
parameter: a: dividend
parameter: b: divisor
return: the truncated remainder

## Method: remU
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Compute the unsigned remainder and truncate it.
parameter: a: dividend
parameter: b: divisor
return: the truncated remainder

## Method: rol
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Rotate left with a modulo\-count.
parameter: a: value to rotate
parameter: n: rotation count
return: the truncated result

## Method: ror
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Rotate right with a modulo\-count.
parameter: a: value to rotate
parameter: n: rotation count
return: the truncated result

## Method: sar
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Arithmetic shift right with a modulo\-count.
parameter: a: value to shift
parameter: n: shift count
return: the truncated result

## Method: setbit
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Set a bit in a value and truncate the result.
parameter: a: value
parameter: n: bit index
return: the truncated result

## Method: shl
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Shift left with a modulo\-count.
parameter: a: value to shift
parameter: n: shift count
return: the truncated result

## Method: shr
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `java.math.BigInteger`

Description: Logical shift right with a modulo\-count.
parameter: a: value to shift
parameter: n: shift count
return: the truncated result

## Method: sub
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Subtract two signed values and truncate the result.
parameter: a: minuend
parameter: b: subtrahend
return: the truncated result

## Method: testbit
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `n`, type: `int`
- return type: `boolean`

Description: Test a bit in a value.
parameter: a: value
parameter: n: bit index
return: true if the bit is set

## Method: toUnsigned
- parameter: `a`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Get the unsigned equivalent of the provided truncated integer. 

 Warning, this method is unsafe\! The result may no longer be representable on bitsize bits.
parameter: a: signed value
return: the unsigned equivalent

## Method: toUnsignedHexString
- parameter: `v`, type: `java.math.BigInteger`
- return type: `java.lang.String`

Description: Format a value as an unsigned hexadecimal string.
parameter: v: value to format
return: the upper\-case unsigned hexadecimal representation

## Method: truncate
- parameter: `val`, type: `java.lang.String`
- return type: `java.math.BigInteger`

Description: Truncate and store as a signed value. The resulting integer 2\-complement representation holds on at most [bitsize](#getBitsize()) bits.
parameter: val: string value \(decimal, hex, or octal \- with the right associated prefix or suffix\)
return: the truncated signed value

## Method: truncate
- parameter: `v`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Truncate and store as a signed value. The resulting integer 2\-complement representation holds on at most [bitsize](#getBitsize()) bits.
parameter: v: value to truncate
return: the truncated signed value

## Method: xor
- parameter: `a`, type: `java.math.BigInteger`
- parameter: `b`, type: `java.math.BigInteger`
- return type: `java.math.BigInteger`

Description: Bitwise XOR two values and truncate the result.
parameter: a: first value
parameter: b: second value
return: the truncated result

## Static Method: create
- parameter: `bitsize`, type: `int`
- return type: `com.pnfsoftware.jeb.util.primitives.LargeIntHandler`

Description: Create or retrieve a handler for a fixed integer bit size.
parameter: bitsize: integer bit size
return: a cached handler for the bit size

