Commit 6e133d5d authored by Thuy Nguyen's avatar Thuy Nguyen Committed by Alexandre Julliard

Fixed rounding in MulDiv.

parent effc55ea
......@@ -1017,12 +1017,12 @@ INT WINAPI MulDiv(
#if (SIZEOF_LONG_LONG >= 8)
long long ret;
if (!nDivisor) return -1;
ret = ((long long)nMultiplicand * nMultiplier) / nDivisor;
ret = (((long long)nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor;
if ((ret > 2147483647) || (ret < -2147483647)) return -1;
return ret;
#else
if (!nDivisor) return -1;
return (nMultiplicand * nMultiplier) / nDivisor;
return ((nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor;
#endif
}
/*******************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment