BigInteger Constructor

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

BigInteger(Byte[]) Constructs a new BigInteger from a byte array containing a two's complement representation of the number.
BigInteger(Decimal) Constructs a new BigInteger for a Decimal value.
BigInteger(Double) Constructs a new BigInteger.
BigInteger(Int128) Constructs a new BigInteger.
BigInteger(Int32) Constructs a new BigInteger.
BigInteger(Int64) Constructs a new BigInteger.
BigInteger(UInt128) Constructs a new BigInteger.
BigInteger(UInt32) Constructs a new BigInteger.
BigInteger(UInt32[]) Constructs a new BigInteger from raw data.
BigInteger(UInt64) Constructs a new BigInteger.
BigInteger(Int32, Byte[]) Constructs a new BigInteger from a sign and a byte array.

BigInteger(Byte[])

Constructs a new BigInteger from a byte array containing a two's complement representation of the number.
C#
public BigInteger(
	byte[] bytes
)

Parameters

bytes  Byte[]
A Byte array that contains the bits of the number. The lowest index corresponds to the least significant byte.

Exceptions

ArgumentNullExceptionbytes is null.

BigInteger(Decimal)

Constructs a new BigInteger for a Decimal value.
C#
public BigInteger(
	decimal value
)

Parameters

value  Decimal
A Decimal value.

Remarks

Any digits after the decimal point are discarded.

BigInteger(Double)

Constructs a new BigInteger.
C#
public BigInteger(
	double value
)

Parameters

value  Double
A Double value.

Exceptions

OverflowExceptionvalue is less than zero.

-or-

value is NaN.

-or-

value is infinite.

BigInteger(Int128)

Constructs a new BigInteger.
C#
public BigInteger(
	Int128 value
)

Parameters

value  Int128
An unsigned 128 bit integer.

BigInteger(Int32)

Constructs a new BigInteger.
C#
public BigInteger(
	int value
)

Parameters

value  Int32
A positive integer

Remarks

value must be greater than or equal to zero. Otherwise, an OverflowException is thrown.

Exceptions

OverflowExceptionvalue is less than zero.

BigInteger(Int64)

Constructs a new BigInteger.
C#
public BigInteger(
	long value
)

Parameters

value  Int64
A positive integer.

Remarks

value must be greater than or equal to zero. Otherwise, an OverflowException is thrown.

Exceptions

OverflowExceptionvalue is less than zero.

BigInteger(UInt128)

Constructs a new BigInteger.
C#
public BigInteger(
	UInt128 value
)

Parameters

value  UInt128
An unsigned 128 bit integer.

BigInteger(UInt32)

Constructs a new BigInteger.
C#
public BigInteger(
	uint value
)

Parameters

value  UInt32
A UInt32 value.

BigInteger(UInt32[])

Constructs a new BigInteger from raw data.
C#
public BigInteger(
	params uint[] data
)

Parameters

data  UInt32[]
A UInt32 array.

BigInteger(UInt64)

Constructs a new BigInteger.
C#
public BigInteger(
	ulong value
)

Parameters

value  UInt64
An unsigned long integer.

BigInteger(Int32, Byte[])

Constructs a new BigInteger from a sign and a byte array.
C#
public BigInteger(
	int sign,
	byte[] bytes
)

Parameters

sign  Int32
An integer that specifies the sign of the BigInteger.
bytes  Byte[]
A Byte array that contains the bits of the number. The lowest index corresponds to the least significant byte.

Exceptions

ArgumentNullExceptionbytes is null.

See Also