Y
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
shric
2066 days ago
This isn't correct, section 6.5.5 states merely that "The operands of the % operator shall have integer type."
link
foldr
2066 days ago
Ah, my bad, it seems this was the case for K&R C but the behavior was since standardized.
link