modulusI function

int modulusI (int dividend, int divisor)

Canonical Modulus. The result has the sign of the divisor.

Implementation

int modulusI(int dividend, int divisor) =>
    ((dividend % divisor) + divisor) % divisor;