oleaut32/tests: added tests for negative fractional variant dates.
Jeremy Drake
wine at jdrake.com
Sat Oct 2 21:00:26 CDT 2010
On Sat, 2 Oct 2010, James McKenzie wrote:
> Looks like you got 'bit' by the way that a finite storage method mangles
> floating information. There was a lengthy discussion on how to 'overcome'
> this on the Wine-Development list a short while ago.
No, those tests aleady account for that.
/* When comparing floating point values we cannot expect an exact match
* because the rounding errors depend on the exact algorithm.
*/
#define EQ_DOUBLE(a,b) (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-14)
#define EQ_FLOAT(a,b) (fabs((a)-(b)) / (1.0+fabs(a)+fabs(b)) < 1e-7)
ok_(__FILE__,line)(r == res && (FAILED(r) || EQ_DOUBLE(out, dt)),
"expected %x, %.16g, got %x, %.16g\n", r, dt, res,
out);
My understanding is that that algorithm should work to account for
floating-point inaccuracies (though technically should be using
DBL_EPSILON and FLT_EPSILON instead of 1e-X constants, but they're
probably not portable enough for this project),
I was simply bit by my own stupidity, not running my last changes against
a Windows OS before sending my patch. This has been corrected in my try2.
> Maybe Dan Kegel can step in and refresh this.
>
> James McKenzie
>
--
The older I grow, the less important the comma becomes. Let the reader
catch his own breath.
-- Elizabeth Clarkson Zwart
More information about the wine-devel
mailing list