2 ms·
Neither of them is wrong. Languages (like python) which only return a positive number are returning the least positive residue of division under the modulus.
by seanhunter 3y ago
Neither of them is wrong. Languages (like python) which only return a positive number are returning the least positive residue of division under the modulus. That is the most common interpretation of it in number theory at least far as I know.
C generally does return negative numbers when you use the % operator.