BigInteger.ToByteArray Method

Converts a BigInteger value to a byte array.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public byte[] ToByteArray()

Return Value

Byte[]
The BigInteger value converted to a byte array.

Remarks

The byte array contains a two's complement representation of the value in little-endian order.

The first (leading) bit of the last byte in the array indicates the sign. A value of 0 indicates that the number is positive. A value of 1 indicates that the number is negative. An extra byte of all 0's (1's) may be added as the last element of the array to make sure that a positive (negative) value is interpreted correctly.

See Also