3 ms·
Returns True when v==0, and yet 0 is not a power of 2. Further, this technique - correctly applied - is essentially #9 in the list.
by ColinWright 15y ago
Returns True when v==0, and yet 0 is not a power of 2.
Further, this technique - correctly applied - is essentially #9 in the list.
- vog 15y agoAccording to the C spec, this is expression is undefined for v == 0. So it might return true, or return false, or start NetHack, or wipe your disk. In other words: Strictly speaken, that function is not allowed to be called for v == 0.
- MostAwesomeDude 15y agoMesa is a GL renderer. POT only matters in 3D for things like texture sizes. Textures aren't allowed to have zero-sized dimensions. The check for v == 0 occurs far higher up the stack than where this function's used. We're not writing bad code, we promise. :3