BigInteger Constructor (UInt64)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the BigInteger structure with an unsigned 64-bit integer value.

This API is not CLS-compliant. The CLS-compliant alternative is BigInteger(Double).

Namespace:  System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Sub New ( _
    value As ULong _
)
[CLSCompliantAttribute(false)]
public BigInteger(
    ulong value
)

Parameters

Remarks

There is no loss of precision when instantiating a BigInteger using this constructor.

The BigInteger value that results from calling this constructor is identical to the value that results from assigning a UInt64 value to a BigInteger.

Examples

The following example uses the BigInteger(UInt64) constructor to instantiate a BigInteger object whose value is equal to MaxValue.

Dim unsignedValue As ULong = UInt64.MaxValue
Dim number As New BigInteger(unsignedValue)
outputBlock.Text &= number.ToString() & vbCrLf
' The example displays the following output:
'       18446744073709551615      
ulong unsignedValue = UInt64.MaxValue;
BigInteger number = new BigInteger(unsignedValue);
outputBlock.Text += number.ToString() + "\n";
// The example displays the following output:
//       18446744073709551615      

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.