-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Numerics
Milestone
Description
Background and Motivation
Continuing with the theme of adding nint/nuint support to certain core locations (intrinsics, math, etc), it would be beneficial to add nint/nuint overloads for various BitOperations APIs. We are already defining and using a few of these internally.
Proposed API
namespace System.Numerics
{
public static partial class BitOperations
{
public static bool IsPow2(nint value);
public static bool IsPow2(nuint value);
public static nuint RoundUpToPowerOf2(nuint value);
public static int LeadingZeroCount(nuint value);
public static int Log2(nuint value);
public static int PopCount(nuint value);
public static int TrailingZeroCount(nint value);
public static int TrailingZeroCount(nuint value);
public static nuint RotateLeft(nuint value, int offset);
public static nuint RotateRight(nuint value, int offset);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Numerics