Skip to content
wolfram77 edited this page Apr 13, 2020 · 14 revisions

Gets a bit.

bit.get(x, i);
// x: an int32
// i: bit index
const bit = require('extra-bit');

bit.get(6, 0);
// 0 (110,0 => 0)

bit.get(6, 1);
// 1 (110,1 => 1)

bit.get(6, 2);
// 1 (110,2 => 1)

references

Clone this wiki locally