function MulDiv(const Number, Numerator, Denominator: Integer): Integer;
Multiplies two 32-bit values (Number and Numerator) and then divides the 64-bit result by a third 32-bit value (Denominator). The final result is rounded to the nearest integer.
If the result is a positive half integer (ends in .5), it is rounded up. If the result is a negative half integer, it is rounded down.