[geos-devel] QD (Quad-Double) Approach to Robustness

strk at refractions.net strk at refractions.net
Wed Jun 14 14:11:04 EDT 2006


On Wed, Jun 14, 2006 at 08:01:53PM +0200, Mateusz Loskot wrote:

> Sandro,
> 
> Your test case is incorrect.
> You can't compare float numbers as you are doing it in the assert:
> 
> assert(tot_check==tot);
> 
> especially if you're working with multiplatform library as GEOS.
> You can only test how close are both numbers.
> 
> There are many problems. float arithmetic on Intel CPUs deos not follow
> IEEE 754, different representation of float numbers on varios
> architectures: FPU calculations are made on 80 bits numbers (ext.
> double) but SSE2 instructions on 64 bits.

Ok, but equality is actually used in JTS too.
Does Java have an automatic approximate equality ?

Beside this, the XML testcase I have attached should
then represent a valid testcase and should be made
to work with the current "sloppy" fp condition.
Problem is that I suppose JTS won't raise the same
problem (having different fp threatment).

--strk;



More information about the geos-devel mailing list