0

In Python signed integer modulo has the same sign as the second operand:

>>> -1 % 10
9

In C signed integer modulo has the same sign as the first operand:

printf("%d\n", -1 % 10); /* prints "-1" */

I'm looking for a simple solution in Python to perform the same modulo operation as in C.

user828227
  • 31
  • 2

0 Answers0