MATH_GetMostSignificantBit

Syntax

#include <nitro/math.h>
u32 MATH_GetMostSignificantBit( u32 x );
u32 MATH_MSB( u32 x );
 
  

Arguments

x The value to scan

Return Values

Returns the highest order bit set to 1.

Description

This function looks for the highest order bit that is set to 1 when x is expressed as a binary 32-bit value. 10(01010b) is 8(01000b), and 0 is 0.

MATH_MSB is another name for the MATH_GetMostSignificantBit function.

The lowest-order bit set to 1 can be found with the MATH_GetLeastSignificantBit function.

See Also

MATH_GetLeastSignificantBit, MATH_ILog2

Revision History

2005/12/22 Initial version.


CONFIDENTIAL