wrapDouble function

double wrapDouble(
  1. double value,
  2. double min,
  3. double max
)

Implementation

double wrapDouble(double value, double min, double max) {
  final range = max - min;
  if (range == 0) {
    return min;
  }
  return (value - min) % range + min;
}