On Sun, 26 Jan 2025 at 18:46, Yury Norov <yury.norov@xxxxxxxxx> wrote: > > > > > > */ > > > val ^= val >> 4; > > > return (0x6996 >> (val & 0xf)) & 1; > > > > If you guys feel that you can explain the algorithm you're employing > in a half-VGA-screen comment, it would be the best choice, and that's > enough. So when I saw this, I even wondered why it needed a comment or reference at all. I thought table-in-a-constant was a standard trick everybody knows. Isn't "The constant 0x6996 has bits set in exactly the positions corresponding to four-bit numbers with odd parity." enough? Rasmus