int main() { unsigned long x = 3; touch(x); if (CountLeadingZeros(x) == NTL_BITS_PER_LONG-2) return 0; else return -1; }
inline unsigned int BitCountNeededToEncode(unsigned int data) { #if defined(_X360) return (32 - CountLeadingZeros(data+1)) - 1; #else unsigned long firstBit; _BitScanReverse(&firstBit,data+1); return firstBit; #endif }
int32 Shader::GetAttributeIndex(eVertexFormat vertexFormat) { return vertexFormatAttribIndeces[CountLeadingZeros(vertexFormat)]; }