MATH_CountTrailingZeros

C Specification

#include <nitro/math.h>
u32 MATH_CountTrailingZeros( u32 x );
u32 MATH_CTZ( u32 x );
 
  

Arguments

x Numeric value to perform calculation.

Return Values

Returns the number of consecutive bits set to 0, starting from the lowest-order bit.

Description

This function finds the number of bits set to 0 starting from the lowest-order bit when x is expressed as a binary 32-bit value. 0x80000000 is 31, and 0 is 32. This is an inline function that uses the MATH_CountLeadingZeros function.

MATH_CTZ is another name for the MATH_CountTrailingZeros function.

To count the number of consecutive 0 from the start, the MATH_CountLeadingZeros function can be used.

See Also

MATH_CountLeadingZeros MATH_ILog2

Revision History

12/22/2005 Initial version.