What is the result of -10%-3?

The result of -10 % -3 is -1.

In modulus calculation with negative numbers, the result is determined by the formula:

remainder = dividend - (dividend / divisor) * divisor

So for -10 % -3:

remainder = -10 - (-10 / -3) * -3
          = -10 - 3 * -3
          = -10 + 9
          = -1

0 Comments

no data
Be the first to share your comment!