Y
Hacker News
new
|
ask
|
show
|
jobs
by
warmfuzzykitten
4541 days ago
That returns true or false, which I believe strictly speaking aren't numeric in Javascript. By definition of problem, probably should be:
function one_bit(x) { return x & (x-1) == 0 ? 1 : 0; }