BigInteger.Implicit Operator

Definition

Defines an implicit conversion between a BigInteger object and another type.

Overloads

Implicit(UInt16 to BigInteger)

Defines an implicit conversion of a 16-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Implicit(Int32 to BigInteger).

Implicit(UInt32 to BigInteger)

Defines an implicit conversion of a 32-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Implicit(Int64 to BigInteger).

Implicit(UInt128 to BigInteger)

Implicitly converts a UInt128 value to a big integer.

Implicit(UIntPtr to BigInteger)

Implicitly converts a UIntPtr value to a big integer.

Implicit(UInt64 to BigInteger)

Defines an implicit conversion of a 64-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Double.

Implicit(SByte to BigInteger)

Defines an implicit conversion of an 8-bit signed integer to a BigInteger value.

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

Implicit(Int128 to BigInteger)

Implicitly converts a Int128 value to a big integer.

Implicit(Int64 to BigInteger)

Defines an implicit conversion of a signed 64-bit integer to a BigInteger value.

Implicit(Int32 to BigInteger)

Defines an implicit conversion of a signed 32-bit integer to a BigInteger value.

Implicit(Int16 to BigInteger)

Defines an implicit conversion of a signed 16-bit integer to a BigInteger value.

Implicit(IntPtr to BigInteger)

Implicitly converts a IntPtr value to a big integer.

Implicit(Char to BigInteger)

Implicitly converts a Char value to a big integer.

Implicit(Byte to BigInteger)

Defines an implicit conversion of an unsigned byte to a BigInteger value.

Implicit(UInt16 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Numerics.BigInteger.Implicit(Int32 to BigInteger)

Defines an implicit conversion of a 16-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Implicit(Int32 to BigInteger).

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(ushort value);

Parameters

value
UInt16

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Attributes

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a UInt16 value to a BigInteger value, as the following example shows.

C#
ushort uShortValue = 25064;
BigInteger number = uShortValue;
number += uShortValue;
Console.WriteLine(number < uShortValue);           // Displays False

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(UInt32 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Numerics.BigInteger.Implicit(Int64 to BigInteger)

Defines an implicit conversion of a 32-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Implicit(Int64 to BigInteger).

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(uint value);

Parameters

value
UInt32

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Attributes

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a UInt32 value to a BigInteger value, as the following example shows.

C#
uint uIntValue = 65000;
BigInteger number = uIntValue;
number = BigInteger.Multiply(number, uIntValue);
Console.WriteLine(number == uIntValue);           // Displays False

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(UInt128 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

Implicitly converts a UInt128 value to a big integer.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(UInt128 value);

Parameters

value
UInt128

The value to convert.

Returns

value converted to a big integer.

Attributes

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

Implicit(UIntPtr to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

Implicitly converts a UIntPtr value to a big integer.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(UIntPtr value);

Parameters

value
UIntPtr

The value to convert.

Returns

value converted to a big integer.

Attributes

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

Implicit(UInt64 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Double

Defines an implicit conversion of a 64-bit unsigned integer to a BigInteger value.

This API is not CLS-compliant. The compliant alternative is Double.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(ulong value);

Parameters

value
UInt64

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Attributes

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt64).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a UInt64 value to a BigInteger value, as the following example shows.

C#
ulong uLongValue = 1358754982;
BigInteger number = uLongValue;
number = number * 2 - uLongValue;
Console.WriteLine(number * uLongValue / uLongValue); // Displays 1358754982

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(SByte to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Numerics.BigInteger.BigInteger(Int32)

Defines an implicit conversion of an 8-bit signed integer to a BigInteger value.

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

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger(sbyte value);

Parameters

value
SByte

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Attributes

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a SByte value to a BigInteger value, as the following example shows.

C#
sbyte sByteValue = -12;
BigInteger number = BigInteger.Pow(sByteValue, 3);
Console.WriteLine(number < sByteValue);            // Displays True

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Int128 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Implicitly converts a Int128 value to a big integer.

C#
public static implicit operator System.Numerics.BigInteger(Int128 value);

Parameters

value
Int128

The value to convert.

Returns

value converted to a big integer.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

Implicit(Int64 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Defines an implicit conversion of a signed 64-bit integer to a BigInteger value.

C#
public static implicit operator System.Numerics.BigInteger(long value);

Parameters

value
Int64

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int64).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a Int64 value to a BigInteger value, as the following example shows.

C#
long longValue = 1358754982;
BigInteger number = longValue;
number = number + (longValue / 2);
Console.WriteLine(number * longValue / longValue); // Displays 2038132473

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Int32 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Defines an implicit conversion of a signed 32-bit integer to a BigInteger value.

C#
public static implicit operator System.Numerics.BigInteger(int value);

Parameters

value
Int32

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a Int32 value to a BigInteger value, as the following example shows.

C#
int intValue = 65000;
BigInteger number = intValue;
number = BigInteger.Multiply(number, intValue);
Console.WriteLine(number == intValue);            // Displays False

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Int16 to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Defines an implicit conversion of a signed 16-bit integer to a BigInteger value.

C#
public static implicit operator System.Numerics.BigInteger(short value);

Parameters

value
Int16

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Remarks

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a Int16 value to a BigInteger value, as the following example shows.

C#
short shortValue = 25064;
BigInteger number = shortValue;
number += shortValue;
Console.WriteLine(number < shortValue);           // Displays False

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(IntPtr to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Implicitly converts a IntPtr value to a big integer.

C#
public static implicit operator System.Numerics.BigInteger(IntPtr value);

Parameters

value
IntPtr

The value to convert.

Returns

value converted to a big integer.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

Implicit(Char to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Implicitly converts a Char value to a big integer.

C#
public static implicit operator System.Numerics.BigInteger(char value);

Parameters

value
Char

The value to convert.

Returns

value converted to a big integer.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

Implicit(Byte to BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

Defines an implicit conversion of an unsigned byte to a BigInteger value.

C#
public static implicit operator System.Numerics.BigInteger(byte value);

Parameters

value
Byte

The value to convert to a BigInteger.

Returns

An object that contains the value of the value parameter.

Remarks

Any fractional part of the value parameter is truncated before conversion.

For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

The overloads of the Implicit(Byte to BigInteger) method define the types to which or from which a compiler can automatically convert a BigInteger value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException. This overload lets the compiler handle conversions from a Byte value to a BigInteger value, as the following example shows.

C#
byte byteValue = 254;
BigInteger number = byteValue;
number = BigInteger.Add(number, byteValue);
Console.WriteLine(number > byteValue);            // Displays True

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0