BigInteger.Implicit 运算符

定义

定义 BigInteger 对象与其他类型之间的隐式转换。Defines an implicit conversion between a BigInteger object and another type.

重载

Implicit(UInt32 to BigInteger)

定义从 32 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 32-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 Implicit(Int64 to BigInteger)The compliant alternative is Implicit(Int64 to BigInteger).

Implicit(UInt16 to BigInteger)

定义从 16 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 16-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 Implicit(Int32 to BigInteger)The compliant alternative is Implicit(Int32 to BigInteger).

Implicit(SByte to BigInteger)

定义从 8 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of an 8-bit signed integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 BigInteger(Int32)The compliant alternative is BigInteger(Int32).

Implicit(UInt64 to BigInteger)

定义从 64 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 64-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 DoubleThe compliant alternative is Double.

Implicit(Int32 to BigInteger)

定义从 32 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 32-bit integer to a BigInteger value.

Implicit(Int16 to BigInteger)

定义从 16 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 16-bit integer to a BigInteger value.

Implicit(Byte to BigInteger)

定义从无符号字节到 BigInteger 值的隐式转换。Defines an implicit conversion of an unsigned byte to a BigInteger value.

Implicit(Int64 to BigInteger)

定义从 64 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 64-bit integer to a BigInteger value.

Implicit(UInt32 to BigInteger)

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Numerics.BigInteger.Implicit(Int64 to BigInteger)

定义从 32 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 32-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 Implicit(Int64 to BigInteger)The compliant alternative is Implicit(Int64 to BigInteger).

public:
 static operator System::Numerics::BigInteger(System::UInt32 value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (uint value);
static member op_Implicit : uint32 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UInteger) As BigInteger

参数

value
UInt32

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

属性

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(UInt32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 UInt32 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a UInt32 value to a BigInteger value, as the following example shows.

uint uIntValue = 65000;
BigInteger number = uIntValue;
number = BigInteger.Multiply(number, uIntValue);
Console.WriteLine(number == uIntValue);           // Displays False     
Dim uIntegerValue As UInteger = 65000
Dim number As BigInteger = uIntegerValue
number = BigInteger.Multiply(number, uIntegerValue)
Console.WriteLine(number = uIntegerValue)           ' Displays False     

Implicit(UInt16 to BigInteger)

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Numerics.BigInteger.Implicit(Int32 to BigInteger)

定义从 16 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 16-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 Implicit(Int32 to BigInteger)The compliant alternative is Implicit(Int32 to BigInteger).

public:
 static operator System::Numerics::BigInteger(System::UInt16 value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (ushort value);
static member op_Implicit : uint16 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UShort) As BigInteger

参数

value
UInt16

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

属性

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(UInt32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 UInt16 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a UInt16 value to a BigInteger value, as the following example shows.

ushort uShortValue = 25064;
BigInteger number = uShortValue;
number += uShortValue;
Console.WriteLine(number < uShortValue);           // Displays False     
Dim uShortValue As UShort = 25064
Dim number As BigInteger = uShortValue
number += uShortValue
Console.WriteLine(number < uShortValue)           ' Displays False     

Implicit(SByte to BigInteger)

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Numerics.BigInteger.BigInteger(Int32)

定义从 8 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of an 8-bit signed integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 BigInteger(Int32)The compliant alternative is BigInteger(Int32).

public:
 static operator System::Numerics::BigInteger(System::SByte value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (sbyte value);
static member op_Implicit : sbyte -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As SByte) As BigInteger

参数

value
SByte

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

属性

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(Int32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 SByte 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a SByte value to a BigInteger value, as the following example shows.

sbyte sByteValue = -12;
BigInteger number = BigInteger.Pow(sByteValue, 3);
Console.WriteLine(number < sByteValue);            // Displays True     
Dim sByteValue As SByte = -12
Dim number As BigInteger = BigInteger.Pow(sByteValue, 3)
Console.WriteLine(number < sByteValue)  ' Displays True     

Implicit(UInt64 to BigInteger)

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Double

定义从 64 位无符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a 64-bit unsigned integer to a BigInteger value.

此 API 不兼容 CLS。This API is not CLS-compliant. 符合的替代方法是 DoubleThe compliant alternative is Double.

public:
 static operator System::Numerics::BigInteger(System::UInt64 value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (ulong value);
static member op_Implicit : uint64 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As ULong) As BigInteger

参数

value
UInt64

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

属性

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(UInt64)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(UInt64).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 UInt64 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a UInt64 value to a BigInteger value, as the following example shows.

ulong uLongValue = 1358754982;
BigInteger number = uLongValue;
number = number * 2 - uLongValue;
Console.WriteLine(number * uLongValue / uLongValue); // Displays 1358754982     
Dim uLongValue As ULong = 1358754982
Dim number As BigInteger = uLongValue
number = number * 2 - uLongValue
Console.WriteLine(number * uLongValue / uLongValue)  ' Displays 1358754982     

Implicit(Int32 to BigInteger)

定义从 32 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 32-bit integer to a BigInteger value.

public:
 static operator System::Numerics::BigInteger(int value);
public static implicit operator System.Numerics.BigInteger (int value);
static member op_Implicit : int -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Integer) As BigInteger

参数

value
Int32

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(Int32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 Int32 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a Int32 value to a BigInteger value, as the following example shows.

int intValue = 65000;
BigInteger number = intValue;
number = BigInteger.Multiply(number, intValue);
Console.WriteLine(number == intValue);            // Displays False     
Dim integerValue As Integer = 65000
Dim number As BigInteger = integerValue
number = BigInteger.Multiply(number, integerValue)
Console.WriteLine(number = integerValue)           ' Displays False     

Implicit(Int16 to BigInteger)

定义从 16 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 16-bit integer to a BigInteger value.

public:
 static operator System::Numerics::BigInteger(short value);
public static implicit operator System.Numerics.BigInteger (short value);
static member op_Implicit : int16 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Short) As BigInteger

参数

value
Int16

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(Int32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 Int16 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a Int16 value to a BigInteger value, as the following example shows.

short shortValue = 25064;
BigInteger number = shortValue;
number += shortValue;
Console.WriteLine(number < shortValue);           // Displays False     
Dim shortValue As Short = 25064
Dim number As BigInteger = shortValue
number += shortValue
Console.WriteLine(number < shortValue)           ' Displays False     

Implicit(Byte to BigInteger)

定义从无符号字节到 BigInteger 值的隐式转换。Defines an implicit conversion of an unsigned byte to a BigInteger value.

public:
 static operator System::Numerics::BigInteger(System::Byte value);
public static implicit operator System.Numerics.BigInteger (byte value);
static member op_Implicit : byte -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Byte) As BigInteger

参数

value
Byte

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

注解

在转换前截断 value 参数的任何小数部分。Any fractional part of the value parameter is truncated before conversion.

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(Int32)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int32).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 Byte 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a Byte value to a BigInteger value, as the following example shows.

byte byteValue = 254;
BigInteger number = byteValue;
number = BigInteger.Add(number, byteValue);
Console.WriteLine(number > byteValue);            // Displays True     
Dim byteValue As Byte = 254
Dim number As BigInteger = byteValue
number = BigInteger.Add(number, byteValue)
Console.WriteLine(number > byteValue)           ' Displays True     

Implicit(Int64 to BigInteger)

定义从 64 位带符号整数到 BigInteger 值的隐式转换。Defines an implicit conversion of a signed 64-bit integer to a BigInteger value.

public:
 static operator System::Numerics::BigInteger(long value);
public static implicit operator System.Numerics.BigInteger (long value);
static member op_Implicit : int64 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Long) As BigInteger

参数

value
Int64

要转换为 BigInteger 的值。The value to convert to a BigInteger.

返回

包含 value 参数值的对象。An object that contains the value of the value parameter.

注解

对于不支持隐式运算符的语言,将 BigInteger.BigInteger(Int64)替代方法。For languages that do not support implicit operators, the alternative method is BigInteger.BigInteger(Int64).

Implicit(Byte to BigInteger) 方法的重载定义了这样的类型,编译器可以在这些类型中自动转换 BigInteger 值,而无需使用显式强制转换运算符C#(在中)或调用转换函数(在 Visual Basic 中)。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). 它们是不涉及数据丢失的扩大转换,不会引发 OverflowExceptionThey are widening conversions that do not involve data loss and do not throw an OverflowException. 此重载使编译器可以处理从 Int64 值到 BigInteger 值的转换,如下面的示例所示。This overload lets the compiler handle conversions from a Int64 value to a BigInteger value, as the following example shows.

long longValue = 1358754982;
BigInteger number = longValue;
number = number + (longValue / 2);
Console.WriteLine(number * longValue / longValue); // Displays 2038132473     
Dim longValue As Long = 1358754982
Dim number As BigInteger = longValue
number = number + (longValue \ 2)
Console.WriteLine(number * longValue / longValue)  ' Displays 2038132473     

适用于