====== (This is the legacy documentation for stable SDL2, the current stable version; [https://wiki.libsdl.org/SDL3/ SDL3] is the current development version.) ======
= SDL_MostSignificantBitIndex32 =
Use this function to get the index of the most significant (set) bit in a
== Header File ==
Defined in [SDL_bits.h](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_bits.h)
== Syntax ==
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x);
== Function Parameters ==
{|
|'''x'''
|the number to find the MSB of
|}
== Return Value ==
Returns the index of the most significant bit of x, or -1 if x is 0.
== Code Examples ==
#include "SDL.h"
#include "SDL_bits.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
SDL_Log("Usage: %s
----
[[CategoryAPI]], [[CategoryAPIFunction]], [[CategoryBits]]