static double roundTo(double n, double x) { return round(doubleRatio(x, n))*n; }