BigInteger Class

Definition

Immutable arbitrary-precision integers.

[Android.Runtime.Register("java/math/BigInteger", DoNotGenerateAcw=true)]
public class BigInteger : Java.Lang.Number, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IComparable
[<Android.Runtime.Register("java/math/BigInteger", DoNotGenerateAcw=true)>]
type BigInteger = class
    inherit Number
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IComparable
Inheritance
BigInteger
Attributes
Implements

Remarks

Java documentation for java.math.BigInteger.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

BigInteger(Byte[])

Translates a byte array containing the two's-complement binary representation of a BigInteger into a BigInteger.

BigInteger(Byte[], Int32, Int32)

Translates a byte sub-array containing the two's-complement binary representation of a BigInteger into a BigInteger.

BigInteger(Int32, Byte[])

Translates the sign-magnitude representation of a BigInteger into a BigInteger.

BigInteger(Int32, Byte[], Int32, Int32)

Translates the sign-magnitude representation of a BigInteger into a BigInteger.

BigInteger(Int32, Int32, Random)

Constructs a randomly generated positive BigInteger that is probably prime, with the specified bitLength.

BigInteger(Int32, Random)

Constructs a randomly generated BigInteger, uniformly distributed over the range 0 to (2<sup>numBits</sup> - 1), inclusive.

BigInteger(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

BigInteger(String)

Translates the decimal String representation of a BigInteger into a BigInteger.

BigInteger(String, Int32)

Translates the String representation of a BigInteger in the specified radix into a BigInteger.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LowestSetBit

Returns the index of the rightmost (lowest-order) one bit in this BigInteger (the number of zero bits to the right of the rightmost one bit).

One

The BigInteger constant one.

PeerReference (Inherited from Object)
Ten

The BigInteger constant ten.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Two

The BigInteger constant two.

Zero

The BigInteger constant zero.

Methods

Abs()

Returns a BigInteger whose value is the absolute value of this BigInteger.

Add(BigInteger)

Returns a BigInteger whose value is (this + val).

And(BigInteger)

Returns a BigInteger whose value is (this & val).

AndNot(BigInteger)

Returns a BigInteger whose value is (this & ~val).

BitCount()

Returns the number of bits in the two's complement representation of this BigInteger that differ from its sign bit.

BitLength()

Returns the number of bits in the minimal two's-complement representation of this BigInteger, <em>excluding</em> a sign bit.

ByteValue()

Returns the value of the specified number as a byte.

(Inherited from Number)
ByteValueExact()

Converts this BigInteger to a byte, checking for lost information.

ClearBit(Int32)

Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CompareTo(BigInteger)

Compares this BigInteger with the specified BigInteger.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Divide(BigInteger)

Returns a BigInteger whose value is (this / val).

DivideAndRemainder(BigInteger)

Returns an array of two BigIntegers containing (this / val) followed by (this % val).

DoubleValue()

Converts this BigInteger to a double.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FlipBit(Int32)

Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped.

FloatValue()

Converts this BigInteger to a float.

Gcd(BigInteger)

Returns a BigInteger whose value is the greatest common divisor of abs(this) and abs(val).

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
IntValue()

Converts this BigInteger to an int.

IntValueExact()

Converts this BigInteger to an int, checking for lost information.

IsProbablePrime(Int32)

Returns true if this BigInteger is probably prime, false if it's definitely composite.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
LongValue()

Converts this BigInteger to a long.

LongValueExact()

Converts this BigInteger to a long, checking for lost information.

Max(BigInteger)

Returns the maximum of this BigInteger and val.

Min(BigInteger)

Returns the minimum of this BigInteger and val.

Mod(BigInteger)

Returns a BigInteger whose value is (this mod m).

ModInverse(BigInteger)

Returns a BigInteger whose value is (this<sup>-1</sup> mod m).

ModPow(BigInteger, BigInteger)

Returns a BigInteger whose value is (this<sup>exponent</sup> mod m).

Multiply(BigInteger)

Returns a BigInteger whose value is (this * val).

Negate()

Returns a BigInteger whose value is (-this).

NextProbablePrime()

Returns the first integer greater than this BigInteger that is probably prime.

Not()

Returns a BigInteger whose value is (~this).

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Or(BigInteger)

Returns a BigInteger whose value is (this | val).

Pow(Int32)

Returns a BigInteger whose value is (this<sup>exponent</sup>).

ProbablePrime(Int32, Random)

Returns a positive BigInteger that is probably prime, with the specified bitLength.

Remainder(BigInteger)

Returns a BigInteger whose value is (this % val).

SetBit(Int32)

Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ShiftLeft(Int32)

Returns a BigInteger whose value is (this << n).

ShiftRight(Int32)

Returns a BigInteger whose value is (this >> n).

ShortValue()

Returns the value of the specified number as a short.

(Inherited from Number)
ShortValueExact()

Converts this BigInteger to a short, checking for lost information.

Signum()

Returns the signum function of this BigInteger.

Sqrt()

Returns the integer square root of this BigInteger.

SqrtAndRemainder()

Returns an array of two BigIntegers containing the integer square root s of this and its remainder this - s*s, respectively.

Subtract(BigInteger)

Returns a BigInteger whose value is (this - val).

TestBit(Int32)

Returns true if and only if the designated bit is set.

ToArray<T>() (Inherited from Object)
ToByteArray()

Returns a byte array containing the two's-complement representation of this BigInteger.

ToString()

Returns a string representation of the object.

(Inherited from Object)
ToString(Int32)

Returns the String representation of this BigInteger in the given radix.

UnregisterFromRuntime() (Inherited from Object)
ValueOf(Int64)

Returns a BigInteger whose value is equal to that of the specified long.

Wait()

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until either another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or a specified amount of time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

(Inherited from Object)
Xor(BigInteger)

Returns a BigInteger whose value is (this ^ val).

Explicit Interface Implementations

IComparable.CompareTo(Object)
IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to