News for hackers. Stuff that matters.
Re:Algo Deck: an open-source collection of 200 cards on algo... by gwilliams on Saturday February 01, 2020 @03:28PM (#22213019)
boolean checkExactlyOneBitSet(int num) {

return (num & (num - 1)) == 0;

}

That looks like it'll fail when num == 0. I think it should be:

  return num && ((num & (num - 1)) == 0);
Re:Algo Deck: an open-source collection of 200 cards on algo... by anentropic on Sunday February 02, 2020 @05:22AM (#22216240)
maybe posting a github issue would be helpful