共用方式為


BitOperations.RoundUpToPowerOf2 方法

定義

多載

RoundUpToPowerOf2(UInt32)

將指定的 UInt32 值四捨五入為兩個乘冪。

RoundUpToPowerOf2(UInt64)

將指定的 UInt64 值四捨五入為兩個乘冪。

RoundUpToPowerOf2(UIntPtr)

將指定的整數值四捨五入為 2 的乘冪。

RoundUpToPowerOf2(UInt32)

來源:
BitOperations.cs
來源:
BitOperations.cs
來源:
BitOperations.cs

重要

此 API 不符合 CLS 規範。

將指定的 UInt32 值四捨五入為兩個乘冪。

public:
 static System::UInt32 RoundUpToPowerOf2(System::UInt32 value);
[System.CLSCompliant(false)]
public static uint RoundUpToPowerOf2 (uint value);
[<System.CLSCompliant(false)>]
static member RoundUpToPowerOf2 : uint32 -> uint32
Public Shared Function RoundUpToPowerOf2 (value As UInteger) As UInteger

參數

value
UInt32

要四捨五入為兩個乘冪的值。

傳回

大於或等於 value之兩個的最小乘冪。 如果 value 為 0 或結果溢位,則傳回 0。

屬性

適用於

RoundUpToPowerOf2(UInt64)

來源:
BitOperations.cs
來源:
BitOperations.cs
來源:
BitOperations.cs

重要

此 API 不符合 CLS 規範。

將指定的 UInt64 值四捨五入為兩個乘冪。

public:
 static System::UInt64 RoundUpToPowerOf2(System::UInt64 value);
[System.CLSCompliant(false)]
public static ulong RoundUpToPowerOf2 (ulong value);
[<System.CLSCompliant(false)>]
static member RoundUpToPowerOf2 : uint64 -> uint64
Public Shared Function RoundUpToPowerOf2 (value As ULong) As ULong

參數

value
UInt64

要四捨五入為兩個乘冪的值。

傳回

大於或等於 value之兩個的最小乘冪。

如果 value 為 0 或結果溢位,則傳回 0。

屬性

適用於

RoundUpToPowerOf2(UIntPtr)

來源:
BitOperations.cs
來源:
BitOperations.cs
來源:
BitOperations.cs

重要

此 API 不符合 CLS 規範。

將指定的整數值四捨五入為 2 的乘冪。

public:
 static UIntPtr RoundUpToPowerOf2(UIntPtr value);
[System.CLSCompliant(false)]
public static UIntPtr RoundUpToPowerOf2 (UIntPtr value);
[<System.CLSCompliant(false)>]
static member RoundUpToPowerOf2 : unativeint -> unativeint
Public Shared Function RoundUpToPowerOf2 (value As UIntPtr) As UIntPtr

參數

value
UIntPtr

unativeint

數值。

傳回

UIntPtr

unativeint

2 的最小電源,大於或等於 value。 如果 value 為 0 或結果溢位,則傳回 0。

屬性

適用於