Miss any of our Open RFC calls?Watch the recordings here! »

@extra-integer/bit-set.min

2.0.0 • Public • Published

Sets a bit of 32-bit integer (left-shift method).

This is part of package extra-integer.

This is browserified, minified version of @extra-integer/bit-set.
It is exported as global variable integer_bit_set.
CDN: unpkg, jsDelivr.

integer.bitSet(x, i, f);
// x: an integer
// i: bit index
// f: bit value (1)
const integer = require('extra-integer');
 
integer.bitSet(6, 0, 1);
// 7 (110,0,1 => 111)
 
integer.bitSet(6, 2, 1);
// 6 (110,2,1 => 110)
 
integer.bitSet(6, 2, 0);
// 2 (110,2,0 => 010)

references

Install

npm i @extra-integer/bit-set.min

DownloadsWeekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

2.45 kB

Total Files

3

Last publish

Collaborators

  • avatar