albertcardona, "Bitwise Binary Search: Elegant and Fast"
https://orlp.net/blog/bitwise-binary-search/"Binary search is notoriously difficult to get correct. A 1988 study [1] found that out of an informal sample of twenty computer science textbooks, only five contained a correct binary search algorithm."
[1] "Textbook errors in binary searching", Pattis 1998 https://dl.acm.org/doi/10.1145/52965.53012