[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: PATCH: control size of image generated by kimgio_eps_read
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-02-12 10:15:47
[Download RAW message or body]

On Tuesday 12 February 2002 02:37, Michael Matz wrote:
> Hi,
> 
> On Tue, 12 Feb 2002, David Faure wrote:
> 
> > EPS is a scalable image format.
> 
> Hopefully I'm not starting a flamewar, but this:
> 
> +            if (params.count() >= 2 && x2 != 0.0 && y2 != 0.0)
> +        if ( xScale != 1.0 || yScale != 1.0 )
> 
> is dubious.  comparing floats/doubles for (in)equaltity is nearly never
> what one wants (instead "a {!=,==} b" do "abs(a-b) {>,<} eps").

The first one is to avoid a divide by zero, but can really never happen,
and the second one is in fact about detecting whether we're in the
"args were explicitely passed" case or not. If not, the scaling has
been initialized to 1.0 explicitely, so the comparison should work fine.
Maybe I should just use a bool instead, if that makes it easier to read?

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david, http://www.konqueror.org
KDE 3.0: Konquering the Desktops

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic