Click or drag to resize
Ab4d.SharpEngine logo

MathUtilsGetSetBitsCount(Int32) Method

Returns the number of bits set to 1. Can be used to count how many flags in an enum value are set.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.1.9680+a1b1e43de1ad9a7e35472c33948d688d7b40ef79
Syntax
C#
public static int GetSetBitsCount(
	int x
)

Parameters

x  Int32
input value

Return Value

Int32
number of bits set to 1
See Also