mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:51:11 +00:00
oleaut32: Fix VarR8Round for negative numbers.
Floats with fractional part 0.5000 should be rounded to next even number. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55185
This commit is contained in:
parent
56e19e2c5e
commit
0d6c905add
|
@ -2716,6 +2716,13 @@ static void test_VarR8Round(void)
|
|||
MATHRND(1.4999, 0); EXPECT(1);
|
||||
MATHRND(1.5000, 0); EXPECT(2);
|
||||
MATHRND(1.5001, 0); EXPECT(2);
|
||||
|
||||
MATHRND(-0.4999, 0); EXPECT(0);
|
||||
MATHRND(-0.5000, 0); EXPECT(0);
|
||||
MATHRND(-0.5001, 0); EXPECT(-1);
|
||||
MATHRND(-1.4999, 0); EXPECT(-1);
|
||||
MATHRND(-1.5000, 0); EXPECT(-2);
|
||||
MATHRND(-1.5001, 0); EXPECT(-2);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -3379,7 +3379,7 @@ HRESULT WINAPI VarR8Round(double dblIn, int nDig, double *pDblOut)
|
|||
else if (fract >= 0.0)
|
||||
dblIn = whole;
|
||||
else if (fract == -0.5)
|
||||
dblIn = whole - fmod(whole, 2.0);
|
||||
dblIn = whole + fmod(whole, 2.0);
|
||||
else if (fract > -0.5)
|
||||
dblIn = whole;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue