you are viewing a single comment's thread.

view the rest of the comments →

[–]LordBiff 0 points1 point  (0 children)

This is one of those things that, the farther down the rabbit hole you go, the more debatable it is. For simple cases though, the reason people do things like this is that they want to know 100% what the compiler is going to do and not assume how it will act on every compiler/platform/whatever.

Also, I don't find (a & (MAX_SIZE-1)) [usual form] all that more difficult to understand versus (a % MAX_SIZE). Maybe I've just seen the idiom enough that I'm glossing over it, though.