logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

findMSB - find the index of the most significant bit set to 1 in an integer

Declaration

genITypefindMSB(genITypevalue);genITypefindMSB(genUTypevalue);

Description

findMSB returns the bit number of the most significant bit that is set to 1 in the binary representation
       of value. For positive integers, the result will be the bit number of the most significant bit that is
       set to 1. For negative integers, the result will be the bit number of the most significant bit set to 0.
       For a value of zero or negative 1, -1 will be returned.

Name

       findMSB - find the index of the most significant bit set to 1 in an integer

Parameters

value
           Specifies the value whose bits to scan.

See Also

findLSB()

Version Support

       ┌──────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │          │        OpenGLShadingLanguageVersion                                            │
       ├──────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name     │      │      │      │      │      │      │      │      │      │      │      │      │
       ├──────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ findMSB  │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       └──────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also