On Wed, Aug 10, 2005 at 09:47 +0200, Petr Salinger wrote:
> Hi,
>
> in floating point code is better to avoid testing with equality.
> In your example, you should change
>
> if (fa == 0.0)
> if (fb == 0.0)
>
> into:
>
> if (fabs(fa) < DBL_EPSILON)
> if (fabs(fb) < DBL_EPSILON)
>
> After that,
Hi,
in floating point code is better to avoid testing with equality.
In your example, you should change
if (fa == 0.0)
if (fb == 0.0)
into:
if (fabs(fa) < DBL_EPSILON)
if (fabs(fb) < DBL_EPSILON)
After that, it works with gcc -O2.
Regards
Petr
--
To UNSUBSCRIBE, email t
2 matches
Mail list logo