Lines Matching full:den
396 * Return (VAL * NUM) / DEN, where DEN is positive
397 * and min(VAL, NUM) <= DEN so the result cannot overflow.
400 public uintmax umuldiv(uintmax val, uintmax num, uintmax den)
403 * Like round(val * (double) num / den), but without rounding error.
406 uintmax q = val / den;
407 uintmax r = val % den;
410 uintmax quot = qnum + rnum / den;
411 uintmax rem = rnum % den;
412 return quot + (den / 2 < rem + (quot & ~den & 1));
419 public int percentage(POSITION num, POSITION den)
421 return (int) muldiv(num, 100, den);