News for hackers. Stuff that matters.
Re:Python, unlike C, has the mod operator always return a po... by williamkuszmaul on Wednesday December 29, 2021 @08:23PM (#29732396)
It's even worse than most people seem to realize. For many years the ISO standard for C included the line:

"If both operands are nonnegative then the remainder is nonnegative; if not, the sign of the remainder is implementation-defined"

Fortunately, this was changed at some point between C '99 and C '11, so that now the remainder is consistently defined across all implementations.

Re:Python, unlike C, has the mod operator always return a po... by tinus_hn on Wednesday December 29, 2021 @10:31PM (#29733219)
Across all implementations that fully support C99, which is not all implementations.