mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 12:03:45 +00:00
Fixed rounding in MulDiv.
This commit is contained in:
parent
effc55ea83
commit
6e133d5d3b
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
/*******************************************************************
|
||||
|
|
Loading…
Reference in a new issue