Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript get bit

function bit_test(num, bit){
    return ((num>>bit) % 2 != 0)
}

function bit_set(num, bit){
    return num | 1<<bit;
}

function bit_clear(num, bit){
    return num & ~(1<<bit);
}

function bit_toggle(num, bit){
    return bit_test(num, bit) ? bit_clear(num, bit) : bit_set(num, bit);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to Keep the Current Tab Active on Page Reload 
Javascript :: convert json string to javascript object 
Javascript :: find particular object from array in js 
Javascript :: how can search in object in array 
Javascript :: reactjs add border to the table row 
Javascript :: javascript prompt to integer 
Javascript :: mongodb mongoose document populate nested document 
Javascript :: javascript lowercase string except first letter of every word 
Javascript :: jquery calculate datetime difference 
Javascript :: shuffling in js 
Javascript :: hide element js 
Javascript :: jquery delay 
Javascript :: datatable set placeholder 
Javascript :: Uncaught ReferenceError: axios is not defined 
Javascript :: js money format br 
Javascript :: react native tabbed sticky view 
Javascript :: filter special characters javascript 
Javascript :: remove empty values from array javascript 
Javascript :: javascript fillstyle 
Javascript :: copy object javascript 
Javascript :: js timestamp 
Javascript :: check if the data can be parsed javascript 
Javascript :: javascript remove period from end of string 
Javascript :: set datetimepicker javascript 
Javascript :: de structuring value from object ES6 and javascript 
Javascript :: javascript redirect to url 
Javascript :: vue test utils emitted 
Javascript :: checking a point is in polygon 
Javascript :: javascript regex escape forward slash 
Javascript :: ajax call too functions.php 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =