Method Summary |
|
public LargeInteger | abs() Returns the absolute value of this large integer. |
public int | bitLength() Returns the minimal number of bits to represent this large integer
in the minimal two's-complement (sign excluded). |
public int | compareTo(LargeInteger that) Compares two large integers numerically.
Parameters: that - the integer to compare with. |
public int | compareTo(long value) Compares this large integer to the specified long value.
Parameters: value - the long value to compare with. |
public LargeInteger | copy() |
public int | digitLength() Returns the minimal number of decimal digits necessary to represent
this large integer (sign excluded). |
public LargeInteger | divide(LargeInteger that) Returns this large integer divided by the one specified (integer
division). |
public LargeInteger | divide(int divisor) Returns this large integer divided by the specified int
divisor. |
public double | doubleValue() Returns the value of this large integer as a double . |
public boolean | equals(Object that) Compares this large integer against the specified object.
Parameters: that - the object to compare with. |
public boolean | equals(long value) Compares this large integer against the specified long
value.
Parameters: value - long value to compare with. |
public static Appendable | format(LargeInteger li, int radix, Appendable out) Formats the specified large integer in the specified radix and into
the specified Appendable argument.
Parameters: li - the large integer to format. Parameters: radix - the radix. Parameters: out - the Appendable to append. |
public LargeInteger | gcd(LargeInteger that) Returns the greatest common divisor of this large integer and
the one specified.
Parameters: that - the other number to compute the GCD with. |
public int | getLowestSetBit() Returns the index of the lowest-order one bit in this large integer
or -1 if this.equals(ZERO) . |
public LargeInteger | getRemainder() Returns the final undivided part after division that is less or of
lower degree than the divisor. |
public int | hashCode() Returns the hash code for this large integer number. |
public LargeInteger | inverseScaled(int precision) Returns a scaled approximation of 1 / this .
Parameters: precision - the requested precision (reciprocal error being ± 1). |
public boolean | isEven() Indicates if this large integer is an even number. |
public boolean | isLargerThan(LargeInteger that) Indicates if this large integer is larger than the one
specified in absolute value.
Parameters: that - the integer to be compared with. |
public boolean | isNegative() Indicates if this large integer is less than
LargeInteger.ZERO . |
public boolean | isOdd() Indicates if this large integer is an odd number. |
public boolean | isPositive() Indicates if this large integer is greater than
LargeInteger.ZERO (
LargeInteger.ZERO is not included). |
public boolean | isPowerOfTwo() Indicates if this number is a power of two (equals to 2
(
LargeInteger.bitLength bitLength() - 1)). |
public boolean | isProbablyPrime() Indicates if this large integer is probably prime. |
public boolean | isZero() Indicates if this large integer is equal to
LargeInteger.ZERO . |
public long | longValue() Returns the low order bits of this large integer as a long . |
public LargeInteger | minus(LargeInteger that) Returns the difference between this large integer and the one
specified.
Parameters: that - the integer to be subtracted. |
public LargeInteger | minus(long value) Returns the difference between this large integer and the specified
value
Parameters: value - the value to be subtracted. |
public LargeInteger | mod(LargeInteger m) Returns this large integer modulo the specified large integer. |
public LargeInteger | modInverse(LargeInteger m) Returns the large integer whose value is (this-1 mod m)
.
Parameters: m - the modulus. |
public LargeInteger | modPow(LargeInteger exp, LargeInteger m) Returns this large integer raised at the specified exponent modulo
the specified modulus.
Parameters: exp - the exponent. Parameters: m - the modulus. |
public LargeInteger | opposite() Returns the opposite of this large integer. |
public static LargeInteger | parse(CharSequence csq, int radix, Cursor cursor) Parses the specified character sequence from the specified position
as a large integer in the specified radix.
Parameters: csq - the character sequence to parse. Parameters: radix - the radix to be used while parsing. Parameters: cursor - the current cursor position (being maintained). |
public LargeInteger | plus(long value) Returns the sum of this large integer with the specified
long integer (convenience method)
Parameters: value - the long integer being added. |
public LargeInteger | plus(LargeInteger that) Returns the sum of this large integer with the one specified.
Parameters: that - the integer to be added. |
public LargeInteger | remainder(LargeInteger that) Returns the remainder of the division of this large integer with
the one specified (convenience method equivalent to
this.divide(that).getRemainder() ).
Parameters: that - the value by which this integer is to be divided, and theremainder returned. |
public LargeInteger | shiftLeft(int n) Returns the value of this large integer after performing a binary
shift to left. |
public LargeInteger | shiftRight(int n) Returns the value of this large integer after performing a binary
shift to right with sign extension (-1 >> 1 == -1) .
The shift distance, n , may be negative, in which case
this method performs a
LargeInteger.shiftLeft(int) .
Parameters: n - the shift distance, in bits. |
public LargeInteger | sqrt() Returns the integer square root of this integer. |
public LargeInteger | times(LargeInteger that) Returns the product of this large integer with the one specified.
Parameters: that - the large integer multiplier. |
public LargeInteger | times(long multiplier) Returns the product of this large integer with the specified
long multiplier.
Parameters: multiplier - the long multiplier. |
public LargeInteger | times10pow(int n) Returns the value of this large integer after multiplication by
a power of ten. |
public LargeInteger | times2pow(int n) Returns the value of this large integer after multiplication by
a power of two. |
public int | toByteArray(byte[] bytes, int offset) Returns the two's-complement binary representation of this
large integer. |
public Text | toText() Returns the text representation of this number using the current
TextFormat.getInstance(Class) format . |
public Text | toText(int radix) Returns the text representation of this number in the specified radix.
Parameters: radix - the radix of the representation. |
public static LargeInteger | valueOf(long value) Returns the large integer of specified long value.
Parameters: value - the long value. |
public static LargeInteger | valueOf(byte[] bytes, int offset, int length) Returns the large integer of specified two's-complement binary
representation. |
public static LargeInteger | valueOf(CharSequence csq) Returns the large integer for the specified character sequence
using the current
TextFormat.getInstance(Class) format .
Parameters: csq - the character sequence to parse. |
public static LargeInteger | valueOf(CharSequence csq, int radix) Returns the large integer for the specified character sequence in
the specified radix.
Parameters: csq - the character sequence to parse. Parameters: radix - the radix of the representation. |
public static LargeInteger | valueOf(java.math.BigInteger bigInteger) Returns the large integer corresponding to the specified
java.math.BigInteger instance.
Parameters: bigInteger - the big integer instance. |