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

List:       koffice-devel
Subject:    double x == 0
From:       Thomas Zander <zander () planescape ! com>
Date:       2001-10-15 16:17:13
[Download RAW message or body]

I have to check if a certain double equals zero. As we know simply doing a
var==0 does not work b/c of mantisse problems.

I wrote 

 if(diff > -0.01 && diff < 0.01) 
    // diff is zero

but I am wondering if people have better solutions for this..

Any input is appriciated, thanx.
-- 
Thomas Zander                                            zander@earthling.net
The only thing worse than failure is the fear of trying something new

[Attachment #3 (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel


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

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