BitOperations.PopCount Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
PopCount(UIntPtr) |
Returns the population count (number of bits set) of a mask. Similar in behavior to the x86 instruction POPCNT. |
PopCount(UInt32) |
Returns the population count (number of bits set) of a mask. |
PopCount(UInt64) |
Returns the population count (number of bits set) of an unsigned 64-bit integer mask. |
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
Important
This API is not CLS-compliant.
Returns the population count (number of bits set) of a mask. Similar in behavior to the x86 instruction POPCNT.
public:
static int PopCount(UIntPtr value);
[System.CLSCompliant(false)]
public static int PopCount (UIntPtr value);
[<System.CLSCompliant(false)>]
static member PopCount : unativeint -> int
Public Shared Function PopCount (value As UIntPtr) As Integer
Parameters
- value
-
UIntPtr
unativeint
The value.
Returns
The population count.
- Attributes
Applies to
.NET 9 та інші версії
Продукт | Версії |
---|---|
.NET | 7, 8, 9 |
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
Important
This API is not CLS-compliant.
Returns the population count (number of bits set) of a mask.
public:
static int PopCount(System::UInt32 value);
[System.CLSCompliant(false)]
public static int PopCount (uint value);
[<System.CLSCompliant(false)>]
static member PopCount : uint32 -> int
Public Shared Function PopCount (value As UInteger) As Integer
Parameters
- value
- UInt32
The mask.
Returns
The population count of a mask.
- Attributes
Remarks
This method is similar in behavior to the x86 instruction POPCNT.
Applies to
.NET 9 та інші версії
Продукт | Версії |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
Important
This API is not CLS-compliant.
Returns the population count (number of bits set) of an unsigned 64-bit integer mask.
public:
static int PopCount(System::UInt64 value);
[System.CLSCompliant(false)]
public static int PopCount (ulong value);
[<System.CLSCompliant(false)>]
static member PopCount : uint64 -> int
Public Shared Function PopCount (value As ULong) As Integer
Parameters
- value
- UInt64
The mask.
Returns
The population count of the mask.
- Attributes
Remarks
This method is similar in behavior to the x86 instruction POPCNT.
Applies to
.NET 9 та інші версії
Продукт | Версії |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
Відгук про .NET
.NET – це проект із відкритим кодом. Виберіть посилання, щоб надати відгук: