3 ms·
My personal rule for "%" operator is: avoid using it with any negative numbers. If you have to, comment well what kind of semantics you expect, and make sure yo
by theamk 6y ago
My personal rule for "%" operator is: avoid using it with any negative numbers. If you have to, comment well what kind of semantics you expect, and make sure you test this semantics.
Programming is about reading the code almost as much as it is about writing it. Writing "% -12" might seem cute, but it will make it harder for the next person to understand what's going on.