Re: [ART_HACK] Hello! libart and floating point comparisons

Alexander Larsson <[email protected]> Tue, 23 Aug 2005 14:50:48 +0200
Newsgroups gmane.comp.gnome.lib.libart.devel
Message-ID <1124801448.19715.21.camel@greebo>
On Mon, 2005-08-22 at 14:15 -0600, Zan Lynx wrote:
> Hi!  I just joined the list.
> 
> So, I've been using Gentoo on AMD64 for a while, and I got extra annoyed
> this weekend with the Gnome Amaranth theme icons and libart.  Some of
> the icons cause libart to go into endless loops spitting messages about
> duplicate horiz segments, etc.  It's caused by some floating point
> values not *quite* matching other floating point values.
> 
> I may have gone a bit overboard.  I recompiled both libart_lgpl and
> librsvg with the -Wfloat-equal flag, downloaded the fcmp library (it's
> just a couple files actually) and replaced EVERY floating point
> comparison in both libraries with a call to fcmp with a epsilon of
> DBL_EPSILON*16.  Voila!  Problem fixed!
> 
> If you're interested in my patch, let me know.

There are general numerical instability problems with libart, and they
are not all fixable in this way. Nobody is currently working on libart,
instead the future goal is using cairo (which is numerically stable) in
the future. Projects like librsvg are moving towards cairo. 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   [email protected]    [email protected] 
He's an obese voodoo paranormal investigator who hangs with the wrong crowd. 
She's a strong-willed bisexual fairy princess with the power to see death. 
They fight crime!