Читати англійською Редагувати

Поділитися через


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.

[System.CLSCompliant(false)]
public static int Log2 (UIntPtr value);

Parameters

value
UIntPtr

The value.

Returns

The logarithm value.

Attributes

Remarks

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

Applies to

.NET 9 та інші версії
Продукт Версії
.NET 7, 8, 9

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.

[System.CLSCompliant(false)]
public static int Log2 (uint value);

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

.NET 9 та інші версії
Продукт Версії
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

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.

[System.CLSCompliant(false)]
public static int Log2 (ulong value);

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

.NET 9 та інші версії
Продукт Версії
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9