Re: C: Dividieren

Philipp Thomas <[email protected]>
Newsgroups gmane.linux.suse.programming
Organization SUSE LINUX AG
Message-ID <[email protected]>
* Stefan Hundhammer ([email protected]) [20041001 12:10]:

> 	if ( fabs( x - 42.0 ) < 1e-5 )
> 	{
> 	    ... // zuverlässiger
> 	}

Da sollte man IMHO DBL_EPSILON bzw. FLT_EPSILON verwenden:

#include <float.h>

 	if ( fabs( x - 42.0 ) <  DBL_EPSILON )
 	{
 	    ... // zuverlässiger
 	}

Philipp

-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.