Hacker News new | ask | show | jobs
by foldr 2066 days ago
Apart from the overall oddness of this, the result of applying the modulo operator to signed arguments is technically undefined behavior in C.
1 comments

This isn't correct, section 6.5.5 states merely that "The operands of the % operator shall have integer type."
Ah, my bad, it seems this was the case for K&R C but the behavior was since standardized.