set: bugfix (invert test; still faster than the old version :-)
This commit is contained in:
parent
c0b2e1256e
commit
97c1ec0ac7
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ var test = func(n, b) {
|
||||||
|
|
||||||
|
|
||||||
# returns number <n> with bit <b> set
|
# returns number <n> with bit <b> set
|
||||||
var set = func(n, b) n + test(n, b) * bit[b];
|
var set = func(n, b) n + !test(n, b) * bit[b];
|
||||||
|
|
||||||
|
|
||||||
# returns number <n> with bit <b> cleared
|
# returns number <n> with bit <b> cleared
|
||||||
|
|
Loading…
Add table
Reference in a new issue