BitOperations.LeadingZeroCount 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.
LeadingZeroCount(UInt32) |
Counts the number of leading zero bits in an unsigned 32-bit integer mask. |
LeadingZeroCount(UInt64) |
Counts the number of leading zero bits in an unsigned 64-bit integer mask. |
LeadingZeroCount(UIntPtr) |
Counts the number of leading zero bits in a mask. Similar in behavior to the x86 instruction LZCNT. |
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
- Source:
- BitOperations.cs
Important
This API is not CLS-compliant.
Counts the number of leading zero bits in an unsigned 32-bit integer mask.
public:
static int LeadingZeroCount(System::UInt32 value);
[System.CLSCompliant(false)]
public static int LeadingZeroCount (uint value);
[<System.CLSCompliant(false)>]
static member LeadingZeroCount : uint32 -> int
Public Shared Function LeadingZeroCount (value As UInteger) As Integer
Parameters
- value
- UInt32
The mask.
Returns
The number of leading zero bits in a mask.
- Attributes
Remarks
This method is similar in behavior to the x86 instruction LZCNT.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.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.
Counts the number of leading zero bits in an unsigned 64-bit integer mask.
public:
static int LeadingZeroCount(System::UInt64 value);
[System.CLSCompliant(false)]
public static int LeadingZeroCount (ulong value);
[<System.CLSCompliant(false)>]
static member LeadingZeroCount : uint64 -> int
Public Shared Function LeadingZeroCount (value As ULong) As Integer
Parameters
- value
- UInt64
The mask.
Returns
The number of leading zero bits in a mask.
- Attributes
Remarks
This method is similar in behavior to the x86 instruction LZCNT.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.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.
Counts the number of leading zero bits in a mask. Similar in behavior to the x86 instruction LZCNT.
public:
static int LeadingZeroCount(UIntPtr value);
[System.CLSCompliant(false)]
public static int LeadingZeroCount (UIntPtr value);
[<System.CLSCompliant(false)>]
static member LeadingZeroCount : unativeint -> int
Public Shared Function LeadingZeroCount (value As UIntPtr) As Integer
Parameters
- value
-
UIntPtr
unativeint
The value.
Returns
The count of leading zeros bits in a mask.
- Attributes
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: