static double max(double v1, double v2, double v3) { double max = v1; if (v2 > max) max = v2; if (v3 > max) max = v3; return max; }