Don't click here unless you want to be banned.

LSL Wiki : LibraryGetBinaryString

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ia360925.us.archive.org

GetBinaryString


In bitwise there are many helpful examples that dump out the bits for viewing. I couldn't find a function for this, so here one is.

// Note, we're poping these bits off the top so our string will be in the right order.
string GetBinaryString(integer val) {
    string retVal = "";
    
    integer counter = 0xffffffff;
    while(counter) {
        if (val & 0x80000000) {
            retVal += "1";
        } else {
            retVal += "0";
        }
        val = val << 1;
        counter = counter << 1;
    }
    return retVal;
}


ScriptLibrary | Dolyn's Scripts
There is no comment on this page. [Display comments/form]