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

List:       koffice-devel
Subject:    Re: double x == 0
From:       Werner Trobin <trobin () kde ! org>
Date:       2001-10-15 17:15:53
[Download RAW message or body]

Thomas Zander wrote:
> 
> 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.

Check http://lists.kde.org/?l=koffice-devel&m=99710839920170&w=2
and related posts from Hasso regarding roundup and stuff in
KSpread.

Ciao,
Werner
_______________________________________________
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