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