remainder function

double remainder(
  1. double x,
  2. double y
)

Implementation

double remainder(double x, double y) {
  double n = rint(x / y);
  return x - n * y;
}