static double[] normalizeDoubles(double[] l) { ret normalizeDoubles(l, 1); } static double[] normalizeDoubles(double[] l, double targetMax) { double factor = normalizationFactor(l, targetMax); if (factor == 1) ret l; int n = l(l); double[] x = new[n]; for i to n: x[i] = l[i]*factor; ret x; }