modulusD function

double modulusD (double dividend, double divisor)

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

Implementation

double modulusD(double dividend, double divisor) =>
    ((dividend % divisor) + divisor) % divisor;