James wrote:
GDI+ uses floating point values for matrix elements so don't you think the result could be slightly different...
No I don't think the results will be slightly different. Higher-precision arithmetic doesn't mean more slop.
Floating point equality comparisons need an error tolerance. See e.g.
http://teaching.idallen.com/cst8110/97s/floating_point.html http://docs.hp.com/en/B3906-90006/ch03s05.html http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems http://search.cpan.org/~dagolden/Test-Number-Delta-1.03/lib/Test/Number/Delt...
And testing matrix math routines is even trickier, it helps to have a really good math background there...
On Sat, Jul 12, 2008 at 4:16 PM, Dan Kegel dank@kegel.com wrote:
Floating point equality comparisons need an error tolerance. See e.g.
http://teaching.idallen.com/cst8110/97s/floating_point.html http://docs.hp.com/en/B3906-90006/ch03s05.html http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems http://search.cpan.org/~dagolden/Test-Number-Delta-1.03/lib/Test/Number/Delt...
Someone goaded me into finding better links (thanks...), so:
http://code.google.com/p/googletest/ is a test framework that gets it right, I think. After peeking at its source, I recalled the magic buzzword: ULP. Searching for floating point comparison ULP finds better links than I found before, e.g. http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm - Dan