Wiki Page Content

Revision 1 as of 2013-02-13 17:41:35

Clear message

DRAFT

SDL_MostSignificantBitIndex32

Use this function to get the index of the most significant (set) bit in a 32-bit number. This is also the same as the base 2 logarithm of the number.

Syntax

Sint8 SDL_MostSignificantBitIndex32(Uint32 x)

Function Parameters

x

the number to find the MSB of

Return Value

Returns the index of the most significant bit if x is > 0, otherwise output is undefined.

Code Examples

if (bitmask) {
    Sint8 index = SDL_MostSignificantBitIndex32(bitmask);
}

Remarks

You can add useful comments here


CategoryAPI, CategoryBits

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit