Condividi tramite


BigInteger Constructors

Definition

Overloads

BigInteger(Byte[])

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

BigInteger(String)

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

BigInteger(Int32, Random)

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

BigInteger(Int32, Byte[])

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

BigInteger(IntPtr, JniHandleOwnership)

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

BigInteger(String, Int32)

Translates the String representation of a BigInteger in the specified radix 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, Int32, Random)

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

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

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

BigInteger(Byte[])

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

[Android.Runtime.Register(".ctor", "([B)V", "")]
public BigInteger (byte[]? val);
[<Android.Runtime.Register(".ctor", "([B)V", "")>]
new Java.Math.BigInteger : byte[] -> Java.Math.BigInteger

Parameters

val
Byte[]

big-endian two's-complement binary representation of a BigInteger.

Attributes

Exceptions

if value == null.

if the length of value is zero.

Remarks

Translates a byte array containing the two's-complement binary representation of a BigInteger into a BigInteger. The input array is assumed to be in big-endian byte-order: the most significant byte is in the zeroth element. The val array is assumed to be unchanged for the duration of the constructor call.

Java documentation for java.math.BigInteger.BigInteger(.*byte[]).

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.

Applies to

BigInteger(String)

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

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public BigInteger (string val);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Java.Math.BigInteger : string -> Java.Math.BigInteger

Parameters

val
String

decimal String representation of BigInteger.

Attributes

Exceptions

if value == null.

if value is not a valid representation of a BigInteger.

Remarks

Java documentation for java.math.BigInteger.BigInteger(java.lang.String).

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.

Applies to

BigInteger(Int32, Random)

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

[Android.Runtime.Register(".ctor", "(ILjava/util/Random;)V", "")]
public BigInteger (int numBits, Java.Util.Random rnd);
[<Android.Runtime.Register(".ctor", "(ILjava/util/Random;)V", "")>]
new Java.Math.BigInteger : int * Java.Util.Random -> Java.Math.BigInteger

Parameters

numBits
Int32

maximum bitLength of the new BigInteger.

rnd
Random

source of randomness to be used in computing the new BigInteger.

Attributes

Exceptions

Remarks

Java documentation for java.math.BigInteger.BigInteger(int, java.util.Random).

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.

Applies to

BigInteger(Int32, Byte[])

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

[Android.Runtime.Register(".ctor", "(I[B)V", "")]
public BigInteger (int signum, byte[]? magnitude);
[<Android.Runtime.Register(".ctor", "(I[B)V", "")>]
new Java.Math.BigInteger : int * byte[] -> Java.Math.BigInteger

Parameters

signum
Int32

signum of the number (-1 for negative, 0 for zero, 1 for positive).

magnitude
Byte[]

big-endian binary representation of the magnitude of the number.

Attributes

Exceptions

if magnitude == null.

if the sign is not one of -1, 0, 1 or if the sign is zero and the magnitude contains non-zero entries.

Remarks

Translates the sign-magnitude representation of a BigInteger into a BigInteger. The sign is represented as an integer signum value: -1 for negative, 0 for zero, or 1 for positive. The magnitude is a byte array in big-endian byte-order: the most significant byte is the zeroth element. A zero-length magnitude array is permissible, and will result in a BigInteger value of 0, whether signum is -1, 0 or 1. The magnitude array is assumed to be unchanged for the duration of the constructor call.

Java documentation for java.math.BigInteger.BigInteger(.*int, .*byte[]).

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.

Applies to

BigInteger(IntPtr, JniHandleOwnership)

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

protected BigInteger (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Math.BigInteger : nativeint * Android.Runtime.JniHandleOwnership -> Java.Math.BigInteger

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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.

Applies to

BigInteger(String, Int32)

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

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;I)V", "")]
public BigInteger (string val, int radix);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;I)V", "")>]
new Java.Math.BigInteger : string * int -> Java.Math.BigInteger

Parameters

val
String

String representation of BigInteger.

radix
Int32

radix to be used in interpreting val.

Attributes

Exceptions

if value == null.

if value is not a valid representation of a BigInteger or if radix or radix > Character.MAX_RADIX.

Remarks

Java documentation for java.math.BigInteger.BigInteger(java.lang.String, int).

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.

Applies to

BigInteger(Byte[], Int32, Int32)

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

[Android.Runtime.Register(".ctor", "([BII)V", "", ApiSince=33)]
public BigInteger (byte[]? val, int off, int len);
[<Android.Runtime.Register(".ctor", "([BII)V", "", ApiSince=33)>]
new Java.Math.BigInteger : byte[] * int * int -> Java.Math.BigInteger

Parameters

val
Byte[]

byte array containing a sub-array which is the big-endian two's-complement binary representation of a BigInteger.

off
Int32

the start offset of the binary representation.

len
Int32

the number of bytes to use.

Attributes

Remarks

Translates a byte sub-array containing the two's-complement binary representation of a BigInteger into a BigInteger. The sub-array is specified via an offset into the array and a length. The sub-array is assumed to be in big-endian byte-order: the most significant byte is the element at index off. The val array is assumed to be unchanged for the duration of the constructor call.

An IndexOutOfBoundsException is thrown if the length of the array val is non-zero and either off is negative, len is negative, or off+len is greater than the length of val.

Added in 9.

Java documentation for java.math.BigInteger.BigInteger(.*byte[], .*int, .*int).

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.

Applies to

BigInteger(Int32, Int32, Random)

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

[Android.Runtime.Register(".ctor", "(IILjava/util/Random;)V", "")]
public BigInteger (int bitLength, int certainty, Java.Util.Random rnd);
[<Android.Runtime.Register(".ctor", "(IILjava/util/Random;)V", "")>]
new Java.Math.BigInteger : int * int * Java.Util.Random -> Java.Math.BigInteger

Parameters

bitLength
Int32

bitLength of the returned BigInteger.

certainty
Int32

a measure of the uncertainty that the caller is willing to tolerate. The probability that the new BigInteger represents a prime number will exceed (1 - 1/2<sup>certainty</sup>). The execution time of this constructor is proportional to the value of this parameter.

rnd
Random

source of random bits used to select candidates to be tested for primality.

Attributes

Exceptions

if bitLength .

Remarks

Java documentation for java.math.BigInteger.BigInteger(int, int, java.util.Random).

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.

Applies to

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

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

[Android.Runtime.Register(".ctor", "(I[BII)V", "", ApiSince=33)]
public BigInteger (int signum, byte[]? magnitude, int off, int len);
[<Android.Runtime.Register(".ctor", "(I[BII)V", "", ApiSince=33)>]
new Java.Math.BigInteger : int * byte[] * int * int -> Java.Math.BigInteger

Parameters

signum
Int32

signum of the number (-1 for negative, 0 for zero, 1 for positive).

magnitude
Byte[]

big-endian binary representation of the magnitude of the number.

off
Int32

the start offset of the binary representation.

len
Int32

the number of bytes to use.

Attributes

Remarks

Translates the sign-magnitude representation of a BigInteger into a BigInteger. The sign is represented as an integer signum value: -1 for negative, 0 for zero, or 1 for positive. The magnitude is a sub-array of a byte array in big-endian byte-order: the most significant byte is the element at index off. A zero value of the length len is permissible, and will result in a BigInteger value of 0, whether signum is -1, 0 or 1. The magnitude array is assumed to be unchanged for the duration of the constructor call.

An IndexOutOfBoundsException is thrown if the length of the array magnitude is non-zero and either off is negative, len is negative, or off+len is greater than the length of magnitude.

Added in 9.

Java documentation for java.math.BigInteger.BigInteger(.*int, .*byte[], .*int, .*int).

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.

Applies to