Edit

Kongsi melalui


BitOperations.Log2 Method

Definition

Overloads

Log2(UIntPtr)

Returns the integer (floor) log of the specified value, base 2.

Log2(UInt32)

Returns the integer (floor) log of the specified value, base 2.

Log2(UInt64)

Returns the integer (floor) log of the specified value, base 2.

Log2(UIntPtr)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Returns the integer (floor) log of the specified value, base 2.

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

Parameters

value
UIntPtr

unativeint

The value.

Returns

The logarithm value.

Attributes

Remarks

By convention, input value 0 returns 0 since log(0) is undefined.

Applies to

Log2(UInt32)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Returns the integer (floor) log of the specified value, base 2.

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

Parameters

value
UInt32

The number from which to obtain the logarithm.

Returns

The log of the specified value, base 2.

Attributes

Remarks

Note that by convention, input value 0 returns 0 since Log(0) is undefined.

Applies to

Log2(UInt64)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Returns the integer (floor) log of the specified value, base 2.

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

Parameters

value
UInt64

The number from which to obtain the logarithm.

Returns

The log of the specified value, base 2.

Attributes

Remarks

Note that by convention, input value 0 returns 0 since Log(0) is undefined.

Applies to