BigInteger.Implicit 運算子
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
定義 BigInteger 物件與另一個型別之間的隱含轉換。
多載
Implicit(UInt16 to BigInteger)
定義從 16 位元不帶正負號的整數到 BigInteger 值的隱含轉換。
此應用程式開發介面不符合 CLS 標準。 符合規範的替代項目為 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);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint16 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UShort) As BigInteger
參數
- value
- UInt16
要轉換為 BigInteger 的值。
傳回
物件,包含 value
參數的值。
- 屬性
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(UInt32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 UInt16 值到 BigInteger 值的轉換,如下列範例所示。
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(UInt32 to BigInteger)
定義從 32 位元不帶正負號的整數到 BigInteger 值的隱含轉換。
此應用程式開發介面不符合 CLS 標準。 符合規範的替代項目為 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);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint32 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UInteger) As BigInteger
參數
- value
- UInt32
要轉換為 BigInteger 的值。
傳回
物件,包含 value
參數的值。
- 屬性
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(UInt32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 UInt32 值到 BigInteger 值的轉換,如下列範例所示。
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(UInt128 to BigInteger)
重要
此 API 不符合 CLS 規範。
隱含地將值轉換成 UInt128 大整數。
public:
static operator System::Numerics::BigInteger(UInt128 value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (UInt128 value);
[<System.CLSCompliant(false)>]
static member op_Implicit : UInt128 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UInt128) As BigInteger
參數
- value
- UInt128
要進行轉換的值。
傳回
value
轉換成大整數。
- 屬性
適用於
Implicit(UIntPtr to BigInteger)
重要
此 API 不符合 CLS 規範。
隱含地將值轉換成 UIntPtr 大整數。
public:
static operator System::Numerics::BigInteger(UIntPtr value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (UIntPtr value);
[<System.CLSCompliant(false)>]
static member op_Implicit : unativeint -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As UIntPtr) As BigInteger
參數
- value
-
UIntPtr
unativeint
要進行轉換的值。
傳回
value
轉換成大整數。
- 屬性
適用於
Implicit(UInt64 to BigInteger)
定義從 64 位元不帶正負號的整數到 BigInteger 值的隱含轉換。
此應用程式開發介面不符合 CLS 標準。 符合規範的替代項目為 Double。
public:
static operator System::Numerics::BigInteger(System::UInt64 value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (ulong value);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint64 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As ULong) As BigInteger
參數
- value
- UInt64
要轉換為 BigInteger 的值。
傳回
物件,包含 value
參數的值。
- 屬性
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(UInt64)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 UInt64 值到 BigInteger 值的轉換,如下列範例所示。
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(SByte to BigInteger)
定義從 8 位元帶正負號的整數到 BigInteger 值的隱含轉換。
此應用程式開發介面不符合 CLS 標準。 符合規範的替代項目為 BigInteger(Int32)。
public:
static operator System::Numerics::BigInteger(System::SByte value);
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.BigInteger (sbyte value);
[<System.CLSCompliant(false)>]
static member op_Implicit : sbyte -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As SByte) As BigInteger
參數
- value
- SByte
要轉換為 BigInteger 的值。
傳回
物件,包含 value
參數的值。
- 屬性
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(Int32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 SByte 值到 BigInteger 值的轉換,如下列範例所示。
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(Int128 to BigInteger)
隱含地將值轉換成 Int128 大整數。
public:
static operator System::Numerics::BigInteger(Int128 value);
public static implicit operator System.Numerics.BigInteger (Int128 value);
static member op_Implicit : Int128 -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Int128) As BigInteger
參數
- value
- Int128
要進行轉換的值。
傳回
value
轉換成大整數。
適用於
Implicit(Int64 to BigInteger)
定義從帶正負號的 64 位元整數到 BigInteger 值的隱含轉換。
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 的值。
傳回
物件,包含 value
參數的值。
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(Int64)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 Int64 值到 BigInteger 值的轉換,如下列範例所示。
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
適用於
Implicit(Int32 to BigInteger)
定義從帶正負號的 32 位元整數到 BigInteger 值的隱含轉換。
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 的值。
傳回
物件,包含 value
參數的值。
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(Int32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 Int32 值到 BigInteger 值的轉換,如下列範例所示。
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 值的隱含轉換。
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 的值。
傳回
物件,包含 value
參數的值。
備註
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(Int32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 Int16 值到 BigInteger 值的轉換,如下列範例所示。
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(IntPtr to BigInteger)
隱含地將值轉換成 IntPtr 大整數。
public:
static operator System::Numerics::BigInteger(IntPtr value);
public static implicit operator System.Numerics.BigInteger (IntPtr value);
static member op_Implicit : nativeint -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As IntPtr) As BigInteger
參數
- value
-
IntPtr
nativeint
要進行轉換的值。
傳回
value
轉換成大整數。
適用於
Implicit(Char to BigInteger)
隱含地將值轉換成 Char 大整數。
public:
static operator System::Numerics::BigInteger(char value);
public static implicit operator System.Numerics.BigInteger (char value);
static member op_Implicit : char -> System.Numerics.BigInteger
Public Shared Widening Operator CType (value As Char) As BigInteger
參數
- value
- Char
要進行轉換的值。
傳回
value
轉換成大整數。
適用於
Implicit(Byte to BigInteger)
定義從不帶正負號的位元組到 BigInteger 值的隱含轉換。
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 的值。
傳回
物件,包含 value
參數的值。
備註
在轉換之前,會截斷參數的任何小數部分 value
。
對於不支援隱含運算子的語言,替代方法是 BigInteger.BigInteger(Int32)。
方法的多 Implicit(Byte to BigInteger) 載會定義編譯程式可以在 C#) 中自動轉換值的型別,或是呼叫 Visual Basic) 中的轉換函式 (時,自動轉換 BigInteger (值。 它們會擴大不會涉及數據遺失且不會擲回的 OverflowException轉換。 此多載可讓編譯程序處理從 Byte 值到 BigInteger 值的轉換,如下列範例所示。
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
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應