static int ratioToIntPercent_avoid100(double x, double y) { int i = roundToInt(x*100/y); ret i >= 100 && x != y ? 99 : 100; }